in reply to Re^2: LWP + NTLM over HTTPS?
in thread LWP + NTLM over HTTPS?

Since you're using Microsoft, take out Authen::NTLM. I use that for my Linux systems sometimes but not always. With Microsoft, LWP uses LWP::Authen::Ntlm indirectly, so you wouldn't normally need to use Authen::NTLM in your script.

Replies are listed 'Best First'.
Re^4: LWP + NTLM over HTTPS?
by jphekman (Novice) on Apr 18, 2010 at 00:14 UTC

    Ah! I got it working. I would not have been able to do so if you had not pointed out how to display the headers, which were invaluable in debugging. Thank you.

    For posterity (since most of the useful information I found about LWP and NTLM I found on PerlMonks): the problem was that I had the wrong NTLM module installed. There appear to be three modules on CPAN called NTLM. I'd found some post saying there were two.

    1. There is Authen::NTLM which only goes up to version 0.31 or so. This is not what you want, and when you install it, it will get run, and will not compile properly -- well, that was what happened to me. I uninstalled this entirely.

    2. There is the NTLM inside of LWP. Which seems at first to be what you want. But when I ran with Authen::NTLM uninstalled, I got the error "Unsupported authentication scheme 'ntlm'". Which suggests that NTLM is not properly installed. Confusing, since I saw an Ntlm.pm on my hard drive in what looked like the appropriate place! I eventually discovered --

    3. http://search.cpan.org/dist/NTLM/. Different from #1, as its version number is 1.05. Also, I believe it somehow installs inside of LWP, or makes itself available to LWP, or something. (I clearly don't know much about how this all works; monks should feel free to correct me.) Once I had installed that, things started working.

    Because the server I'm using is using HTTPS, I also had to futz some with certificates and passphrases, but that is incidental to the above problem, which was the big one.

    Thanks again for the help.

    Jessica

Re^4: LWP + NTLM over HTTPS?
by jphekman (Novice) on Apr 17, 2010 at 23:26 UTC

    (FWIW, I am not using Microsoft, although the remote server I'm trying to access must be, so far as I know.)

    When I remove Authen::NTLM from the script which you gave me above, I do end up with the same errors as when it was in: undefined subroutine ntlmv2, or if I comment out that line, then the failure to compile of /usr/local/share/perl/5.10.0/LWP/Authen/Ntlm.pm

    Thanks for your help so far!

    Jessica