NTLM Proxy Authentication

Tim Hoke <[email protected]> Tue, 20 May 2014 15:16:18 -0500
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <CA+cYX3bmMehFxJsScbFgGHBB-We0Gt=iihKcJ5qCBb8HokD40w@mail.gmail.com>
--20cf3071ce587ea99004f9da8d2c
Content-Type: text/plain; charset=UTF-8

Hello Everyone,

I'm trying to take v6.06 of LWP (and the corresponding v6.06 of
LWP::Protocol::https) and connect to an https endpoint through an NTLM
Authenticated http proxy.  I've managed to make the CONNECT method work for
basic authentication via pull request 56 (
https://github.com/libwww-perl/libwww-perl/pull/56), but I'm not able to
get NTLM authentication working.

I've tried bringing in benningm's proxy auth pull request (
https://github.com/libwww-perl/libwww-perl/pull/49) and I can make it NTLM
authentication work if I've got an http endpoint, just not to an https
endpoint.  I suspect it's because of the CONNECT method required for
proxying https connections via http.

FWIW, I've also made a modification to LWP::UserAgent:
$ diff -u UserAgent.pm-orig UserAgent.pm
--- UserAgent.pm-orig 2014-04-29 12:15:20.000000000 -0500
+++ UserAgent.pm 2014-05-20 14:51:48.595255000 -0500
@@ -618,7 +618,7 @@
 sub get_basic_credentials
 {
     my($self, $realm, $uri, $proxy) = @_;
-    return if $proxy;
+    return $self->credentials($uri->host_port) if $proxy;
     return $self->credentials($uri->host_port, $realm);
 }


Does anyone have any pointers on how I might resolve this?

Thanks
-Tim
[email protected]

--20cf3071ce587ea99004f9da8d2c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello Everyone,<div><br></div><div>I&#39;m trying to take =
v6.06 of LWP (and the corresponding v6.06 of LWP::Protocol::https) and conn=
ect to an https endpoint through an NTLM Authenticated http proxy. =C2=A0I&=
#39;ve managed to make the CONNECT method work for basic authentication via=
 pull request 56 (<a href=3D"https://github.com/libwww-perl/libwww-perl/pul=
l/56">https://github.com/libwww-perl/libwww-perl/pull/56</a>), but I&#39;m =
not able to get NTLM authentication working.</div>
<div><br></div><div>I&#39;ve tried bringing in benningm&#39;s proxy auth pu=
ll request (<a href=3D"https://github.com/libwww-perl/libwww-perl/pull/49">=
https://github.com/libwww-perl/libwww-perl/pull/49</a>) and I can make it N=
TLM authentication work if I&#39;ve got an http endpoint, just not to an ht=
tps endpoint. =C2=A0I suspect it&#39;s because of the CONNECT method requir=
ed for proxying https connections via http.</div>
<div><br></div><div>FWIW, I&#39;ve also made a modification to LWP::UserAge=
nt:</div><div>$ diff -u UserAgent.pm-orig UserAgent.pm</div><div>--- UserAg=
ent.pm-orig<span class=3D"" style=3D"white-space:pre">	</span>2014-04-29 12=
:15:20.000000000 -0500</div>
<div>+++ UserAgent.pm<span class=3D"" style=3D"white-space:pre">	</span>201=
4-05-20 14:51:48.595255000 -0500</div><div>@@ -618,7 +618,7 @@</div><div>=
=C2=A0sub get_basic_credentials</div><div>=C2=A0{</div><div>=C2=A0 =C2=A0 =
=C2=A0my($self, $realm, $uri, $proxy) =3D @_;</div>
<div>- =C2=A0 =C2=A0return if $proxy;</div><div>+ =C2=A0 =C2=A0return $self=
-&gt;credentials($uri-&gt;host_port) if $proxy;</div><div>=C2=A0 =C2=A0 =C2=
=A0return $self-&gt;credentials($uri-&gt;host_port, $realm);</div><div>=C2=
=A0}</div><div><br></div><div><br></div>
<div>Does anyone have any pointers on how I might resolve this?</div><div><=
br></div><div>Thanks</div><div>-Tim</div><div><a href=3D"mailto:thoke@north=
peak.org">[email protected]</a></div></div>

--20cf3071ce587ea99004f9da8d2c--