Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Justin Bailey
RE: cannot use rubysspi with NTLM proxy serve [ reply ]  
2008-08-04 15:50
Sorry for the long delay - I missed your last reply apparently.

It looks like your proxy only uses "Basic" authentication, not NTLM. You can see that in it's reply here:

-> "HTTP/1.1 407 Proxy Authentication Required\r\n"
-> "Proxy-Authenticate: BASIC realm=\"mydomain\"\r\n"

RubySSPI works for "Negotiate" type authentication. Ruby net/http already supports basic authentication so you don't need rubysspi.

By: Navjeet Chabbewal
RE: cannot use rubysspi with NTLM proxy serve [ reply ]  
2008-08-04 15:34
Justin,

Did you had a chance to look into this? I am trying again with rubysspi version 1.2.4 and hitting the same issue. The output of trace_proxy.rb is also the same. I will appreciate any help with this issue.

By: Navjeet Chabbewal
RE: cannot use rubysspi with NTLM proxy serve [ reply ]  
2007-11-05 16:28
1. I am not sure about ISA server.
2. The http_proxy variable does not include http as suggested by you.

Here is the output of trace_proxy.rb (I have replaced my actual domain with word "mydomain")

C:\ruby\lib\ruby\gems\1.8\gems\rubysspi-1.2.3\test>ruby trace_proxy.rb
opening connection to eastproxy.mydomain.com...
opened
<- "GET http://www.google.com/ HTTP/1.1\r\nAccept: */*\r\nHost: http://www.google.com\r
\nProxy-Authorization: Negotiate TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAFASg
KAAAADw==\r\n\r\n"
-> "HTTP/1.1 407 Proxy Authentication Required\r\n"
-> "Proxy-Authenticate: BASIC realm=\"mydomain\"\r\n"
-> "Cache-Control: no-cache\r\n"
-> "Pragma: no-cache\r\n"
-> "Content-Type: text/html; charset=utf-8\r\n"
-> "Proxy-Connection: close\r\n"
-> "Set-Cookie: BCSI-CS9B68EF11=2; Path=/\r\n"
-> "Connection: close\r\n"
-> "Content-Length: 830\r\n"
-> "\r\n"
reading 830 bytes...
-> "<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD>\n<BODY>\n<FONT face=\"He
lvetica\">\n<big><strong></strong></big><BR>\n</FONT>\n<blockquote>\n<TABLE bord
er=0 cellPadding=1 width=\"80%\">\n<TR><TD>\n<FONT face=\"Helvetica\">\n<big>Acc
ess Denied (authentication_failed)</big>\n<BR>\n<BR>\n</FONT>\n</TD></TR>\n<TR><
TD>\n<FONT face=\"Helvetica\">\nYour credentials could not be authenticated: \"A
nother round of authentication required.\". You will not be permitted access unt
il your credentials can be verified.\n</FONT>\n</TD></TR>\n<TR><TD>\n<FONT face=
\"Helvetica\">\nThis is typically caused by an incorrect username and/or passwor
d, but could also be caused by network problems.\n</FONT>\n</TD></TR>\n<TR><TD>\
n<FONT face=\"Helvetica\" SIZE=2>\n<BR>\nFor assistance, contact your net"
-> "work support team.\n</FONT>\n</TD></TR>\n</TABLE>\n</blockquote>\n</FONT>\n<
/BODY></HTML>\n"
read 830 bytes
Conn close
./../lib/win32/sspi.rb:297:in `complete_authentication': Error: SEC_E_INVALID_TO
KEN (RuntimeError)
from trace_proxy.rb:33
from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
from trace_proxy.rb:30

By: Justin Bailey
RE: cannot use rubysspi with NTLM proxy serve [ reply ]  
2007-11-05 16:02
Navjeet,

A couple of questsions and a request:

1) Is the proxy server Microsoft's ISA server? I've never tested against any other.

2) Does your http_proxy variable look like this: http://proxy.corp.com:8080 (or whatever the URL and port is)? The "http" portion is critical

3) There is a script called "trace_proxy.rb" in the test directory. If the above don't help, run that and paste the output here.

Justin

By: Navjeet Chabbewal
cannot use rubysspi with NTLM proxy server [ reply ]  
2007-11-05 15:45
After a while I am trying to use rubysspi so that i can insall ruby gems. I installed latest (v 1.2.3) rubysspi gem on my windows XP box, setup the http_proxy env to my proxy server and it does not seem to work. I ran the test file test_ruby_sspy.rb abd here is the output:

C:\ruby\lib\ruby\gems\1.8\gems\rubysspi-1.2.3\test>ruby test_ruby_sspi.rb
Loaded suite test_ruby_sspi
Started
EEEE
Finished in 1.262 seconds.

1) Error:
test_auth(NTLMTest):
RuntimeError: Error: SEC_E_INVALID_TOKEN
./../lib/win32/sspi.rb:297:in `complete_authentication'
test_ruby_sspi.rb:36:in `test_auth'
c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
c:/ruby/lib/ruby/1.8/net/http.rb:440:in `start'
test_ruby_sspi.rb:33:in `test_auth'

2) Error:
test_one_time_use_only(NTLMTest):
RuntimeError: Error: SEC_E_INVALID_TOKEN
./../lib/win32/sspi.rb:297:in `complete_authentication'
test_ruby_sspi.rb:60:in `test_one_time_use_only'
c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
c:/ruby/lib/ruby/1.8/net/http.rb:440:in `start'
test_ruby_sspi.rb:57:in `test_one_time_use_only'

3) Error:
test_proxy_auth_get(NTLMTest):
RuntimeError: Error: SEC_E_INVALID_TOKEN
./../lib/win32/sspi.rb:297:in `complete_authentication'
./../lib/win32/sspi.rb:229:in `proxy_auth_get'
test_ruby_sspi.rb:49:in `test_proxy_auth_get'
c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
c:/ruby/lib/ruby/1.8/net/http.rb:440:in `start'
test_ruby_sspi.rb:48:in `test_proxy_auth_get'

4) Error:
test_token_variations(NTLMTest):
RuntimeError: Error: SEC_E_INVALID_TOKEN
./../lib/win32/sspi.rb:297:in `complete_authentication'
test_ruby_sspi.rb:76:in `test_token_variations'
c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
c:/ruby/lib/ruby/1.8/net/http.rb:440:in `start'
test_ruby_sspi.rb:72:in `test_token_variations'

4 tests, 8 assertions, 0 failures, 4 errors