开发者

Question on authentication in curl command

开发者 https://www.devze.com 2023-03-25 21:52 出处:网络
When I run the below curl command with --negotiate option I get the following error. Any idea why? [Aug05 5:03am] pradeep@localhost:/tmp/pradeep>curl --negotiate -u : -k --verbose --head\"http://som

When I run the below curl command with --negotiate option I get the following error. Any idea why?

[Aug05 5:03am] pradeep@localhost:/tmp/pradeep> curl --negotiate -u : -k --verbose --head "http://something.domain.com/something/soething.action"

About to connect() to something.domain.com port 80 (#0)
Trying ip-address ... c开发者_Go百科onnected
Connected to something.domain.com (ip-address) port 80 (#0)
HEAD /something.action HTTP/1.1
User-Agent: curl/7.21.6 (i386-pc-solaris2.10) libcurl/7.21.6 OpenSSL/0.9.8j zlib/1.2.3
Host: something.domain.com
Accept: */*
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
< Date: Fri, 05 Aug 2011 09:04:45 GMT
Date: Fri, 05 Aug 2011 09:04:45 GMT
< Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
* gss_init_sec_context() failed: : KDC policy rejects requestWWW-Authenticate: Negotiate
WWW-Authenticate: Negotiate
< Set-Cookie: JSESSIONID=0E94E134D7401632EBB4D042B8934DCD; Path=/
Set-Cookie: JSESSIONID=0E94E134D7401632EBB4D042B8934DCD; Path=/
< Content-Type: text/plain
Content-Type: text/plain
* no chunk, no close, no size. Assume close to signal end

I am able to open the site normally from the browser etc. Why I am I not able to authenticate here? Can someone help me understand


Two things you can try:

  1. Remove --head. You seem to want to send a GET request, not a HEAD request.

  2. Don't forget to provide the credentials as with this example: -u pierre:secret

0

精彩评论

暂无评论...
验证码 换一张
取 消