Could not verify server signature with net-ssh against Cygwin
-------------------------------------------------------------
Key: JRUBY-3895
URL: http://jira.codehaus.org/browse/JRUBY-3895
Project: JRuby
Issue Type: Bug
Components: OpenSSL
Affects Versions: JRuby 1.3.1
Environment: Client Windows XP, Server: SSH-2.0-OpenSSH_5.0 on Windows
2003/Cygwin
Reporter: Yohei Kaneko
Net-ssh operation seem to give error when ran against Cygwin OpenSSH
environment(OpenSSH_5.0p1, OpenSSL 0.9.8g 19 Oct 2007). Same script works fine
when run against RHEL5 or Solaris 9 machine.
* JRuby 1.3.1
* jruby-openssl 0.5.1
* net-ssh 2.0.13
{noformat}
>> require 'rubygems'
=> true
>> require 'net/ssh'
=> true
>> Net::SSH.start('myhost', 'myuser', :verbose => :debug) {|ssh|
>> ssh.exec!('pwd') }
D, [2009-08-20T09:47:13.674000 #4472] DEBUG -- net.ssh.transport.session[22]:
establishing connection to myhost:22
D, [2009-08-20T09:47:13.689000 #4472] DEBUG -- net.ssh.transport.session[22]:
connection established
I, [2009-08-20T09:47:13.705000 #4472] INFO --
net.ssh.transport.server_version[24]: negotiating protocol version
D, [2009-08-20T09:47:13.892000 #4472] DEBUG --
net.ssh.transport.server_version[24]: remote is `SSH-2.0-OpenSSH_5.0'
D, [2009-08-20T09:47:13.892000 #4472] DEBUG --
net.ssh.transport.server_version[24]: local is `SSH-2.0-Ruby/Net::SSH_2.0.13
java'
D, [2009-08-20T09:47:14.002000 #4472] DEBUG -- tcpsocket[2e]: read 784 bytes
D, [2009-08-20T09:47:14.017000 #4472] DEBUG -- tcpsocket[2e]: received packet
nr 0 type 20 len 780
I, [2009-08-20T09:47:14.017000 #4472] INFO --
net.ssh.transport.algorithms[30]: got KEXINIT from server
I, [2009-08-20T09:47:14.017000 #4472] INFO --
net.ssh.transport.algorithms[30]: sending KEXINIT
D, [2009-08-20T09:47:14.033000 #4472] DEBUG -- tcpsocket[2e]: queueing packet
nr 0 type 20 len 556
D, [2009-08-20T09:47:14.033000 #4472] DEBUG -- tcpsocket[2e]: sent 560 bytes
I, [2009-08-20T09:47:14.033000 #4472] INFO --
net.ssh.transport.algorithms[30]: negotiating algorithms
D, [2009-08-20T09:47:14.033000 #4472] DEBUG --
net.ssh.transport.algorithms[30]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-dss
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2009-08-20T09:47:14.033000 #4472] DEBUG --
net.ssh.transport.algorithms[30]: exchanging keys
D, [2009-08-20T09:47:14.846000 #4472] DEBUG -- tcpsocket[2e]: queueing packet
nr 1 type 34 len 20
D, [2009-08-20T09:47:14.846000 #4472] DEBUG -- tcpsocket[2e]: sent 24 bytes
D, [2009-08-20T09:47:14.846000 #4472] DEBUG -- tcpsocket[2e]: read 152 bytes
D, [2009-08-20T09:47:14.846000 #4472] DEBUG -- tcpsocket[2e]: received packet
nr 1 type 31 len 148
D, [2009-08-20T09:47:14.955000 #4472] DEBUG -- tcpsocket[2e]: queueing packet
nr 2 type 32 len 140
D, [2009-08-20T09:47:14.955000 #4472] DEBUG -- tcpsocket[2e]: sent 144 bytes
D, [2009-08-20T09:47:14.971000 #4472] DEBUG -- tcpsocket[2e]: read 656 bytes
D, [2009-08-20T09:47:14.971000 #4472] DEBUG -- tcpsocket[2e]: received packet
nr 2 type 33 len 636
OpenSSL::PKey::PKeyError: invalid signature
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/openssl.rb:104:in
`ssh_do_verify'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:187:in
`verify_signature'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:69:in
`exchange_keys'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:331:in
`exchange_keys'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:172:in
`proceed!'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:163:in
`send_kexinit'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:118:in
`accept_kexinit'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:186:in
`poll_message'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:164:in
`loop'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:164:in
`poll_message'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:201:in
`wait'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:199:in
`loop'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:199:in
`wait'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:78:in
`initialize'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh.rb:179:in
`start'
from (irb):4
{noformat}
I have also seen following exception numerous times instead.
{noformat}
Net::SSH::Exception: could not verify server signature
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:188:in
`verify_signature'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:69:in
`exchange_keys'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:331:in
`exchange_keys'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:172:in
`proceed!'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:163:in
`send_kexinit'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/algorithms.rb:118:in
`accept_kexinit'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:186:in
`poll_message'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:164:in
`loop'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:164:in
`poll_message'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:201:in
`wait'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:199:in
`loop'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:199:in
`wait'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh/transport/session.rb:78:in
`initialize'
from
C:/tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/net-ssh-2.0.13/lib/net/ssh.rb:179:in
`start'
from (irb):4
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email