Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^4: curl sends basic instead of digest

by Anonymous Monk
on Jul 15, 2012 at 13:42 UTC ( #981900=note: print w/replies, xml ) Need Help??

in reply to Re^3: curl sends basic insted of ntlm
in thread curl sends basic insted of ntlm

I think I am seeing a similar issue with digest authentication My code...
$url = 'http://localhost'; $user = 'TBC'; $password = 'TBC'; $file = 'IMG_6345.JPG'; @params = ('file' => $file); $curl = new WWW::Curl::Easy; $curl->setopt(CURLOPT_VERBOSE, 1); $curl->setopt(CURLOPT_URL, $url); $curl->setopt(CURLOPT_CONNECTTIMEOUT, 10); $curl->setopt(CURLOPT_TIMEOUT, 300); $curl->setopt(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); $curl->setopt(CURLOPT_USERPWD, "$user:$password"); $curl->setopt(CURLOPT_POST, 1); $curl->setopt(CURLOPT_POSTFIELDS, \@params); $curl->setopt(CURLOPT_RETURNTRANSFER, 1); $body = $curl->perform; print($body);
Output... note despite Digest being set it is using Basic
* About to connect() to localhost port 80 (#0) * Trying * connected * Connected to localhost ( port 80 (#0) * Server auth using Basic with user 'tbc' > POST / HTTP/1.1 Authorization: Basic ZgVtbzpweXRob24= Host: localhost Accept: */* Content-Length: 16 Content-Type: application/x-www-form-urlencoded * upload completely sent off: 16 out of 16 bytes < HTTP/1.1 401 Unauthorized < Date: Sun, 15 Jul 2012 13:28:45 GMT < Server: Apache < WWW-Authenticate: Digest realm="realm",qop="auth",nonce="MGVjNTu4ZmV +lNzNkMjM0ZGI5ZDE2NGY4MGExOWJiODY6MTM0MjM1OTIyNQ==" < Connection: close < Transfer-Encoding: chunked < Content-Type: text/plain;charset=UTF-8 < This service requires authentication. Please contact your account mana +ger. * Closing connection #0
My Amazon Linux AMI instance has the following installed
perl-WWW-Curl.i686 4.09-3.5.amzn1 @am +zn-main perl-core.i686 5.10.1-119.12.amzn1 amz +n-main
Any thoughts?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981900]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2018-03-21 05:45 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (263 votes). Check out past polls.