Mitch has asked for the wisdom of the Perl Monks concerning the following question:

Perl: ActiveState 5.6.1, OS: Windows 2000

Hi, I'm trying to get the contents of a webpage, but I can't get through my company's Microsoft Proxy server with Lwp::Useragent. The reason for this is that the Proxy server requires NTLM authentication. I am able to get around this problem if I install Winsock proxy client on my workstation or if I run the job from the proxy server. However, our Security Department wont allow this as a long term solution. I found a module called

Authen::NTLM

But, the documentation is geared towards IMAP. I also found some examples on this site, but I couldn't get it to work. I was hoping someone could point me to some good documentation for using Authen::NTLM with Lwp::Useragent or provide a simple example, such as...

use LWP::UserAgent; use HTTP::Request::Common; use Authen::NTLM; ntlm_reset(); ntlm_domain(Domain); ntlm_user(username); ntlm_password(password); # How does the ntlm functions tie in with Lwp methods? $ua = new LWP::UserAgent(); $ua->proxy('http','proxyserver'); $resp = $ua->request(GET "http://www.perl.com"); $htmcode=$resp->{_content}; print "here comes the output...\n$htmcode\n";

Any help would be much appreciated, thank you.
Mitch

Replies are listed 'Best First'.
Re: Proxy NTLM Authentication
by gjb (Vicar) on Jul 03, 2003 at 16:52 UTC

    I've tried to get something to work in a similar setup and failed.

    I did end up using Net::SOCKS and direct socket read/writes, handcoding the HTTP requests. I can't remember whether or not I had to negociate with the proxy admin to change settings, but I think not.

    Hope this helps, although I'd prefer you get some better answers, -gjb-

      Thanks for the feedback, trying Net::Socks is one of my considerations if I can't get the NTLM working.