java - JSch 0.1.54 dh-group14-sha1 Algorithm negotiation fail -


i have added java unlimited policy files , read solutions other posters have asked here, still can not solve problem.

  1. upgraded jsch 0.1.54
  2. installed unlimitedjcepolicy files. c:\program files\java\jdk1.7.0_21\jre\lib\security. have verified netbeans using instance of jdk.

i able connect ssh key-exchange group dh-group1-sha1 set on firewall, when change ssh key-exchange group dh-group14-sha1 receive following error:

caused by: com.jcraft.jsch.jschexception: algorithm negotiation fail @ com.jcraft.jsch.session.receive_kexinit(session.java:590) @ com.jcraft.jsch.session.connect(session.java:320) @ com.jcraft.jsch.session.connect(session.java:183) 

i create jsch session follows:

properties config = new properties(); config.put("kex", "diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256"); config.put("stricthostkeychecking", "no"); session.setconfig(config); session.connect(); 

i have followed solutions other questions have had, have far been unable solve issue. please help.

here log file server.

ssh: host key initialised ssh1: starting ssh control process ssh1: exchanging versions - ssh-1.99-cisco-1.25  ssh1: send ssh message: outdata null  server version string:ssh-1.99-cisco-1.25 ssh1: receive ssh message: 83 (83) ssh1: client version - ssh-2.0-jsch-0.1.54  client version string:ssh-2.0-jsch-0.1.54  ssh2 1: ssh2_msg_kexinit sent ssh2 1: ssh2_msg_kexinit received ssh2: kex: client->server aes128-ctr hmac-md5 none ssh2: kex: server->client aes128-ctr hmac-md5 none ssh2 0: kex algo not supported: client diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchan ssh2 1: ssh: kex_choose_conf errorssh1: session disconnected ssh server - error 0x00 "internal error" 

here jsch logs:

info: connection established info: remote version string: ssh-1.99-cisco-1.25 info: local version string: ssh-2.0-jsch-0.1.54 info: checkciphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256 info: checkkexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521 info: diffie-hellman-group14-sha1 not available. info: checksignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 info: ssh_msg_kexinit sent info: ssh_msg_kexinit received info: kex: server: diffie-hellman-group14-sha1 info: kex: server: ssh-rsa info: kex: server: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr info: kex: server: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr info: kex: server: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 info: kex: server: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 info: kex: server: none info: kex: server: none info: kex: server:  info: kex: server:  info: kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 info: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 info: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc info: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc info: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 info: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 info: kex: client: none info: kex: client: none info: kex: client:  info: kex: client:  

apparently need use jdk 8 "diffie-hellman-group14-sha1".

see jsch.java static block:

config.put("diffie-hellman-group14-sha1",             "com.jcraft.jsch.dhg14");    // available since jdk8. 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -