SSPI NTLM proxy auth using httpclient


I’ve actually become interested in Ruby as as a direct result of trying
to solve the problem of accessing the internet through a corporate
proxy. The ONLY way this appears to be possible is via the combination
of SSPI and NTLM because while we can find out our username/domain we do
not know our passwords, they come from a USB authentication key.

While searching for solution using python (which almost all failed
spectacularly, except for one VERY unstable and flawed implementation
using direct calls to windll.wininet) I noticed httpclient for Ruby
which purported to support EVERYTHING I needed.

However, being completely new to Ruby I find the documentation for
httpclient to be quite confusing. If someone could give an example of
how I would handle NTLM proxy authentication via SSPI I would appreciate
it greatly.

I hope for this to become my gateway to learning Ruby, as if I can get
this to work, I will be fully invested in Ruby for all the scripts I
want to write in future.

Thank you in advance.


P.S. Briefly the following curl (compiled with SSPI support) script
worked. Something changed on the corporate network though and it stopped

curl -U : --proxy-ntlm --proxy http://proxy:8080