Hi Jamis,
I originally wasn''t going to post this because I
wasn''t sure of the official status on Win32, but some
folks on IRC convinced me that I should, so here it
goes. :)
Windows XP Pro SP 2
Ruby 1.8.2 (Installer)
There appear to be problems with the various proxy
tests. For now, I''ll just post the results of
tc_http.rb (the others are very similar or identical):
C:\ruby\src\net-ssh-0.9.0\test\proxy>ruby tc_http.rb
Loaded suite tc_http
Started
EEEEEEEEEEEEEEEE
Finished in 18.094 seconds.
1) Error:
test_connect_auth_success(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:155:in `test_connect_auth_success''
2) Error:
test_connect_auth_success(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
3) Error:
test_connect_auth_success_with_CONNECT_vars(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:195:in
`test_connect_auth_success_with_CONNECT_vars''
4) Error:
test_connect_auth_success_with_CONNECT_vars(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
5) Error:
test_connect_auth_success_with_HTTP_PROXY_vars(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:175:in
`test_connect_auth_success_with_HTTP_PROXY_vars''
6) Error:
test_connect_auth_success_with_HTTP_PROXY_vars(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
7) Error:
test_connect_error(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:90:in `test_connect_error''
8) Error:
test_connect_error(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
9) Error:
test_connect_error_bad_auth(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:135:in `test_connect_error_bad_auth''
10) Error:
test_connect_error_bad_auth(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
11) Error:
test_invalid_auth_scheme(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:118:in `test_invalid_auth_scheme''
12) Error:
test_invalid_auth_scheme(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
13) Error:
test_no_auth_ok(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:80:in `test_no_auth_ok''
14) Error:
test_no_auth_ok(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
15) Error:
test_unauthorized_error_no_user(TC_Proxy_HTTP):
SocketError: getaddrinfo: no address associated with
hostname.
tc_http.rb:38:in `initialize''
tc_http.rb:38:in `new''
tc_http.rb:38:in `run''
tc_http.rb:103:in
`test_unauthorized_error_no_user''
16) Error:
test_unauthorized_error_no_user(TC_Proxy_HTTP):
NoMethodError: undefined method `shutdown'' for
nil:NilClass
tc_http.rb:59:in `shutdown''
tc_http.rb:75:in `teardown''
8 tests, 0 assertions, 0 failures, 16 errors
Any ideas?
Dan
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
On 19:11 Tue 11 Jan , Daniel Berger wrote:> Hi Jamis, > > I originally wasn''t going to post this because I > wasn''t sure of the official status on Win32, but some > folks on IRC convinced me that I should, so here it > goes. :)Dan, Thanks for posting. I actually encountered this same error shortly after I released 0.9 today, when I thought to try it in my VMWare installation. :) Silly me, testing AFTER I released. The problem appears to be with the ''hostbased'' authentication method, but I haven''t had a chance to hunt it down very far. The hostbased authentication method is tried second (after publickey), and it looks up the name of the current host so it can send it to the server. Apparently, the approach I''m using to get the current hostname isn''t very successful on Windows. If anyone knows a "correct" way to get the hostname on windows (Dan?), I''m all ears. Otherwise, I''ll have to throttle my frustration with Windows and try and do some debugging on it. (I''ve just had lousy luck trying to do any kind of Ruby development in Windows...) I''ll keep you posted. And if anyone figures anything out with this, I''d love to hear about it. - Jamis> > Windows XP Pro SP 2 > Ruby 1.8.2 (Installer) > > There appear to be problems with the various proxy > tests. For now, I''ll just post the results of > tc_http.rb (the others are very similar or identical): > > C:\ruby\src\net-ssh-0.9.0\test\proxy>ruby tc_http.rb > Loaded suite tc_http > Started > EEEEEEEEEEEEEEEE > Finished in 18.094 seconds. > > 1) Error: > test_connect_auth_success(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:155:in `test_connect_auth_success'' > > 2) Error: > test_connect_auth_success(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 3) Error: > test_connect_auth_success_with_CONNECT_vars(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:195:in > `test_connect_auth_success_with_CONNECT_vars'' > > 4) Error: > test_connect_auth_success_with_CONNECT_vars(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 5) Error: > test_connect_auth_success_with_HTTP_PROXY_vars(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:175:in > `test_connect_auth_success_with_HTTP_PROXY_vars'' > > 6) Error: > test_connect_auth_success_with_HTTP_PROXY_vars(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 7) Error: > test_connect_error(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:90:in `test_connect_error'' > > 8) Error: > test_connect_error(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 9) Error: > test_connect_error_bad_auth(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:135:in `test_connect_error_bad_auth'' > > 10) Error: > test_connect_error_bad_auth(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 11) Error: > test_invalid_auth_scheme(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:118:in `test_invalid_auth_scheme'' > > 12) Error: > test_invalid_auth_scheme(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 13) Error: > test_no_auth_ok(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:80:in `test_no_auth_ok'' > > 14) Error: > test_no_auth_ok(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 15) Error: > test_unauthorized_error_no_user(TC_Proxy_HTTP): > SocketError: getaddrinfo: no address associated with > hostname. > tc_http.rb:38:in `initialize'' > tc_http.rb:38:in `new'' > tc_http.rb:38:in `run'' > tc_http.rb:103:in > `test_unauthorized_error_no_user'' > > 16) Error: > test_unauthorized_error_no_user(TC_Proxy_HTTP): > NoMethodError: undefined method `shutdown'' for > nil:NilClass > tc_http.rb:59:in `shutdown'' > tc_http.rb:75:in `teardown'' > > 8 tests, 0 assertions, 0 failures, 16 errors > > Any ideas? > > Dan > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - now with 250MB free storage. Learn more. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Net-ssh-users mailing list > Net-ssh-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/net-ssh-users-- Jamis Buck jamis_buck@byu.edu http://www.jamisbuck.org/jamis ------------------------------ "I am Victor of Borge. You will be assimil-nine-ed."
--- Jamis Buck <jamis_buck@byu.edu> wrote: <snip>> Apparently, the approach I''m using to get the > current hostname isn''t > very successful on Windows.I''m not sure where to look to see what it is exactly that you''re doing.> If anyone knows a "correct" way to get the hostname > on windows (Dan?), > I''m all ears.Last I checked, Socket.gethostname worked as well on Win32 systems as it does on Unix. Is there a reason this doesn''t/won''t work? If not, I know one or two other ways of getting the hostname that should be reliable on Win32, including straight C, the Win32API module or the win32ole module plus WMI. You can also take a look at sys-host and/or sys-uname for Win32. Or did you mean IP address? I tried IPSocket.getaddress(Socket.gethostname) and it worked fine, though it returned my internal IP rather than my external one (I have DSL). I have no idea how to get an external IP address. Regards, Dan __________________________________ Do you Yahoo!? All your favorites on one personal page ? Try My Yahoo! http://my.yahoo.com
On 20:56 Tue 11 Jan , Daniel Berger wrote:> > --- Jamis Buck <jamis_buck@byu.edu> wrote: > > <snip> > > > Apparently, the approach I''m using to get the > > current hostname isn''t > > very successful on Windows. > > I''m not sure where to look to see what it is exactly > that you''re doing.It is in net/ssh/transport/session.rb on line 106. I''m no socket wizard, so I have only a vague idea of what it is doing. I pulled it from the OpenSSH hostbased authentication implementation.> > If anyone knows a "correct" way to get the hostname > > on windows (Dan?), > > I''m all ears. > > Last I checked, Socket.gethostname worked as well on > Win32 systems as it does on Unix. Is there a reason > this doesn''t/won''t work? If not, I know one or two > other ways of getting the hostname that should be > reliable on Win32, including straight C, the Win32API > module or the win32ole module plus WMI. You can also > take a look at sys-host and/or sys-uname for Win32. > > Or did you mean IP address? I tried > IPSocket.getaddress(Socket.gethostname) and it worked > fine, though it returned my internal IP rather than my > external one (I have DSL). I have no idea how to get > an external IP address.I actually need the fully-qualified host name. Socket.gethostname only returns the name of the host, not the fully-qualified name. I''m beginning to wonder whether it is worth support hostbased authentication at all. (Does anyone actually use it? It seems pretty insecure to me.) Could you try this workaround, Dan? 1) Open net/ssh/lib/userauth/services.rb 2) Go to line 99. 3) Delete that line: [ "publickey", --> "hostbased", "password", 4) See if the tests run correctly. If that works, I may just disable hostbased authentication and see if anyone shouts. - Jamis -- Jamis Buck jamis_buck@byu.edu http://www.jamisbuck.org/jamis ------------------------------ "I am Victor of Borge. You will be assimil-nine-ed."