views:

11656

answers:

4

Firewall I'm behind is running Microsoft ISA server (NTLM only mode), anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method?

... or am I just being lazy?

Edit: rubysspi-1.2.4 does not work

UPDATE: This also works for "igem", part of the IronRuby project

+1  A: 

A workaround is to install http://apserver.sourceforge.net on your local machine, configure it and run gems through this proxy.

  • Install: Just download apserver 097 (and not the experimental 098!) and unpack.
  • Configure: Edit the server.cfg file and put the values for your MS proxy in PARENT_PROXY and PARENT_PROXY_PORT. Enter the values for DOMAIN and USER. Leave PASSWORD blank (nothing after the colon) – you will be prompted when launching it.
  • Run apserver: cd aps097; python main.py
  • Run Gems: gem install—http-proxy http://localhost:5865/ library
Jarin Udom
Read in a google group that 'apserver' is now 'NTLM Authorization Server'; shame that searching for the former doesn't redirect to that latter.
Darren
Hi Jarin,I went to the link you provided in your comment and couldn't find that download. Is there any way I can download it from anywhere else?
Matrich
+12  A: 
Wolfbyte
It seems 'gem' fails to recognize backslashes in the proxy string, whether by http_proxy env var or --http-proxy argument. e.g. from my Ubuntu box --http-proxy http ://domain\\userid@server:port gives me the error: "invalid argument: --http-proxy ..."; Fortunately, my proxy server didn't require the domain specification and gem worked without it.
spoulson
ISA lets the admin specify a default domain to authenticate against. You can try to leave out the domain and just use your username like spoulson suggests. If your ISA admin has specified said default domain and your useraccount is in that domain, this should work for you (assuming there are no blocking rules on the firewall)
squillman
Thanks this worked! Wonder why it didnt work when i tried the -p and --http-proxy command line args. It seems like the env var is what works.
Gishu
+11  A: 

I've been using cntlm (http://cntlm.sourceforge.net/) at work. Configuration is very similar to ntlmaps.

Works great, and also allows me to connect my Ubuntu box to the ISA proxy.

Check out http://cntlm.wiki.sourceforge.net/ for more information

Jason Navarrete
+2  A: 

Posts abound regarding this topic, and to help others save hours of trying different solutions, here is the final result of my hours of tinkering.

The three solutions around the internet at the moment are: rubysspi apserver cntlm

rubysspi only works from a Windows machine, AFAIK, as it relies on the Win32Api library. So if you are on a Windows box trying to run through a proxy, this is the solution for you. If you are on a Linux distro, you're out of luck.

apserver seems to be a dead project. The link listed in the posts I've seen lead to 404 page on sourceforge. I search for "apserver" on sourceforge returns nothing.

The sourceforge link for cntlm that I've seen redirects to http://cntlm.awk.cz/, but that times out. A search on sourceforge turns up this link, which does work: http://sourceforge.net/projects/cntlm/

After downloading and configuring cntlm I have managed to install a gem through the proxy, so this seems to be the best solution for Linux distros.