Net::SSH gives OpenSSL::Cipher::CipherError "No message available"
------------------------------------------------------------------

                 Key: JRUBY-4075
                 URL: http://jira.codehaus.org/browse/JRUBY-4075
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby-OpenSSL 0.5.2
         Environment: Solaris 10, JRuby 1.3.1, net-ssh (2.0.15), jruby-openssl 
(0.5.2)
            Reporter: Paul Blair


We're on Solaris 10, using JRuby 1.3.1 (but we've seen the problem under 
regular Ruby 1.8.7 as well), trying to communicate with another Solaris  10
machine. The first problem we ran into was an UnimplementedCipher error, so we 
restricted the ciphers we're using to ones that are implemented in 
the Ruby Net::SSH module. Now Net::SSH gives us an OpenSSL::Cipher::CipherError 
with "No message available."

Here's the code we use to test our ability to connect:

require 'rubygems'
require 'net/ssh'
Net::SSH.start('[HOST]', '[USER]', :verbose => :debug) do |ssh|
   puts ssh.exec!("hostname")
end

And here's the result:

jruby -S ssh_troubleshooting.rb
D, [2009-10-05T11:05:47.046000 #17498] DEBUG -- net.ssh.transport.session[98]: 
establishing connection to [HOST:PORT]
D, [2009-10-05T11:05:47.096000 #17498] DEBUG -- net.ssh.transport.session[98]: 
connection established
I, [2009-10-05T11:05:47.102000 #17498]  INFO -- 
net.ssh.transport.server_version[9a]: negotiating protocol version
D, [2009-10-05T11:05:47.115000 #17498] DEBUG -- 
net.ssh.transport.server_version[9a]: remote is `SSH-2.0-Sun_SSH_1.1.2'
D, [2009-10-05T11:05:47.116000 #17498] DEBUG -- 
net.ssh.transport.server_version[9a]: local is  `SSH-2.0-Ruby/Net::SSH_2.0.15 
java'
D, [2009-10-05T11:05:48.188000 #17498] DEBUG -- tcpsocket[9c]: read 376 bytes
D, [2009-10-05T11:05:49.026000 #17498] DEBUG -- tcpsocket[9c]: received packet 
nr 0 type 20 len 372
I, [2009-10-05T11:05:49.032000 #17498]  INFO -- 
net.ssh.transport.algorithms[9e]: got KEXINIT from server
I, [2009-10-05T11:05:49.037000 #17498]  INFO -- 
net.ssh.transport.algorithms[9e]: sending KEXINIT
D, [2009-10-05T11:05:49.045000 #17498] DEBUG -- tcpsocket[9c]: queueing packet 
nr 0 type 20 len 556
D, [2009-10-05T11:05:49.047000 #17498] DEBUG -- tcpsocket[9c]: sent 560 bytes
I, [2009-10-05T11:05:49.050000 #17498]  INFO -- 
net.ssh.transport.algorithms[9e]: negotiating algorithms
D, [2009-10-05T11:05:49.066000 #17498] DEBUG -- 
net.ssh.transport.algorithms[9e]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-md5
* hmac_server: hmac-md5
* compression_client: zlib
* compression_server: zlib
* language_client:
* language_server:
D, [2009-10-05T11:05:49.067000 #17498] DEBUG -- 
net.ssh.transport.algorithms[9e]: exchanging keys
D, [2009-10-05T11:05:53.597000 #17498] DEBUG -- tcpsocket[9c]: queueing packet 
nr 1 type 34 len 20
D, [2009-10-05T11:05:53.599000 #17498] DEBUG -- tcpsocket[9c]: sent 24  bytes
D, [2009-10-05T11:05:53.613000 #17498] DEBUG -- tcpsocket[9c]: read 152 bytes
D, [2009-10-05T11:05:53.617000 #17498] DEBUG -- tcpsocket[9c]: received packet 
nr 1 type 31 len 148
D, [2009-10-05T11:05:54.174000 #17498] DEBUG -- tcpsocket[9c]: queueing packet 
nr 2 type 32 len 140
D, [2009-10-05T11:05:54.176000 #17498] DEBUG -- tcpsocket[9c]: sent 144 bytes
D, [2009-10-05T11:05:54.212000 #17498] DEBUG -- tcpsocket[9c]: read 464 bytes
D, [2009-10-05T11:05:54.215000 #17498] DEBUG -- tcpsocket[9c]: received packet 
nr 2 type 33 len 444
D, [2009-10-05T11:05:54.987000 #17498] DEBUG -- tcpsocket[9c]: queueing packet 
nr 3 type 21 len 20
D, [2009-10-05T11:05:54.989000 #17498] DEBUG -- tcpsocket[9c]: sent 24  bytes
D, [2009-10-05T11:05:54.993000 #17498] DEBUG -- tcpsocket[9c]: received packet 
nr 3 type 21 len 12
D, [2009-10-05T11:05:55.009000 #17498] DEBUG -- 
net.ssh.authentication.session[a6]: beginning authentication of `[USER]'
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/state.rb:79:in
 `update_cipher': No message available (OpenSSL::Cipher::CipherError)
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:139:in
 `enqueue_packet'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:108:in
 `send_packet'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/session.rb:217:in
 `send_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:52:in
 `authenticate'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh.rb:183:in 
`start'
        from /path/to/test/code/ssh_troubleshooting.rb:3


Changing .ssh/config settings to 

Compression     no
ForwardX11      no

made no difference (unlike with the next bug I'm filing). Neither did changing 
the cipher.

-- 
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


Reply via email to