dsx has asked for the wisdom of the Perl Monks concerning the following question:
hello guys
i want download a file from a IIS webserver which requires ntlm authentication. but WWW::Curl::Easy sends a basic-authentication-header. what could be the problem?
#!/usr/bin/perl open(TMPF, ">", "tempfile"); print "User: "; chomp($user = <STDIN>); if (system("stty -echo") == 0){ print "Password: "; chomp($pw = <STDIN>); }else{ print "stty -echo failed"; exit 1; } system("stty echo"); use WWW::Curl::Easy; my $curl = WWW::Curl::Easy->new; $curl->setopt(CURLOPT_URL,'http://ugly_iis/securedoument.txt'); $curl->setopt(CURLOPT_FOLLOWLOCATION,1); $curl->setopt(CURLOPT_UNRESTRICTED_AUTH,1); $curl->setopt(CURLOPT_HTTPAUTH,CURLAUTH_NTLM); $curl->setopt(CURLOPT_USERPWD,$user . ':' . $pw); $curl->setopt(CURLOPT_FILE,TMPF); my $retcode = $curl->perform; close(TMPF);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: curl sends basic insted of ntlm
by Anonymous Monk on Dec 07, 2011 at 11:09 UTC | |
by dsx (Novice) on Dec 09, 2011 at 10:20 UTC | |
by dsx (Novice) on Feb 06, 2012 at 10:26 UTC | |
by riverron (Sexton) on Feb 07, 2012 at 17:14 UTC | |
by Anonymous Monk on Jul 15, 2012 at 13:42 UTC |