Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: curl sends basic insted of ntlm

by Anonymous Monk
on Dec 07, 2011 at 11:09 UTC ( #942214=note: print w/replies, xml ) Need Help??


in reply to curl sends basic insted of ntlm

Ask curl  $curl->setopt(CURLOPT_VERBOSE,1);

Replies are listed 'Best First'.
Re^2: curl sends basic insted of ntlm
by dsx (Novice) on Dec 09, 2011 at 10:20 UTC

    hy

    the verbose mode gave me the following error

    gss_init_sec_context() failed: : Credentials cache file '/tmp/krb5cc_1000' not found< WWW-Authenticate: Negotiate

    seems to be a bug of libcurl if curl is built with NSS insted of OpenSSL. but curl --version gives me

    curl --version curl 7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2 +.3.4 libidn/1.15 libssh2/1.2.6 x Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 po +p3s rtsp scp sftp smtp smtps telnet tftp Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

    how can i find out wich version of libcurl perl does use?

      the problem was a bug in the version 4.12 of the module WWW::Curl which is used in the debian package libwww-perl-curl. the bug is fixed in the recent version of WWW::Curl http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/Changes
        Verified this works on WWW::Curl 4.15. I'm already going desperate trying to make LWP work against an NTLM-protected webserver until I saw this post. Problem solved in no time! Thanks, ++ for this!
        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 46.137.176.6... * connected * Connected to localhost (46.137.176.6) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942214]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2016-10-01 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (8 votes). Check out past polls.