39

The requirement is to ssh from one server to multiple server and execute a command.

When I do this I frequently, but not always, receive this exception when trying to ssh from one server to another. What could be the reason for this and how can it be fixed? Any help could be great. Thanks in advance!

jcraft.jsch.JSchException: verify: false 
     at jcraft.jsch.Session.connect(Session.java:309) 
     at jcraft.jsch.Session.connect(Session.java:162)
Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
dinesh kumar
  • 391
  • 1
  • 3
  • 5
  • 1
    We will investigate that problem. – ymnk Feb 22 '13 at 06:45
  • I get the problem with my test code on v.0.1.54. Awaiting an answer: https://stackoverflow.com/questions/50300995/unit-testing-code-that-uses-jsch-lib-with-a-fake-sftp – djangofan May 11 '18 at 22:28

4 Answers4

19

jsch 0.1.50 has been released and it fixes this problem.

The download page for jsch is http://www.jcraft.com/jsch/

Jesse
  • 1,603
  • 19
  • 20
antoine
  • 287
  • 2
  • 9
  • 15
    JSch 0.1.50 solved it for almost a year but now the problem occurs again. Even JSch 0.1.51 results in 'verify false' once in about 500 SSH executions. Does anyone else has the problem again? – Tim Gerlach Jun 14 '14 at 14:22
  • 1
    We also have the problem using 0.1.50. – BlackEye Feb 05 '15 at 09:19
  • 1
    Using Jsch 0.1.51 and Java 1.7_13 this is a problem for me as well, so if anyone has any ideas how to solve, they're most welcome – Johann J. Feb 09 '15 at 16:28
  • 1
    I have this problem even when using the latest release of Jsch (0.1.54). – Mirko Seifert Dec 15 '16 at 11:34
  • JSch is a horribly messy library with an unsensible API. I wish there were a better alternative. – lostsoul29 Jun 30 '17 at 01:22
  • The fix @antoine mentioned is actually in 0.1.51 not 0.1.50, I guess their changlog's confusing wording is to blame : "Changes since version 0.1.50" means 0.1.51 – yusong May 20 '20 at 21:44
  • I got this error message on jsch 0.1.53 but it's been fixed on jsch 0.1.55. It was not an regression of the same issue. People got this same message by underlying different issues. – Changwoo Ryu Dec 14 '21 at 05:48
4

I have experienced the same problem using Java 1.7.0_07 on Windows 64 bits together with Ant 1.7.1 and jsch-0.1.44.jar. Also using Ant 1.9.0-alpha and jsch-0.1.49. I have reported this issue on the tracker of jsch at sourceforge.

A similar bug report has been made by someone using Ivy, jsch and Java 1.7 IVY-1374

Users of gradle also reported the same as gradle-ssh-plugin issue 11.

antoine
  • 287
  • 2
  • 9
  • 3
    Atsuhiko Yamanaka wrote : It seems JCE included in Java7u6(and later) has suddenly changed its behavior. Please try following version, http://www.jcraft.com/jsch/jsch-0.1.50-rc1.zip We have confirmed this version can make 10,000 connections without "verify: false" errors on Java7u15. – antoine Mar 01 '13 at 02:32
0

The problem persist, the other 2 answer are right.

1) exist a bug in versions before 0.1.49 in version 0.1.49 was theoretically fixed here is the change log

2) exist an interaction between java 1.7 and jsch and in that circunstancies the bug appear

It happen to me all the time. I believe that it happen because some plugin don't update their dependencies and they have jsch lower than 0.1.50 as include.

IE: ssh credential plugin https://github.com/jenkinsci/ssh-credentials-plugin

I add a pull request to change the dependencies but they don't answer yet.

Emiliano
  • 698
  • 9
  • 30
  • The fix is actually in 0.1.51 not 0.1.50, I guess their changlog's confusing wording is to blame : "Changes since version 0.1.50" means 0.1.51 – yusong May 20 '20 at 21:45
0

The fix @antoine mentioned is actually in 0.1.51 not 0.1.50, I guess jsch changlog's confusing wording is to blame : "Changes since version 0.1.50" means 0.1.51

Following page "[JSch-users] ANNOUNCE: JSch 0.1.51" should be more clear https://sourceforge.net/p/jsch/mailman/message/32115165/

It says

JSch 0.1.51 has been released. It is available at
http://sourceforge.net/projects/jsch/files/jsch/0.1.51/jsch-0.1.51.zip/download and its md5sum is 89d0ff6d36040622da0a482e51d87725 And you can get its byte code in jar file format at
http://sourceforge.net/projects/jsch/files/jsch.jar/0.1.51/jsch-0.1.51.jar/download and its md5sum is de3a2b0d03295f167fea1904939443cf

Changes since version 0.1.50: - bugfix: reproducibility of "verify: false". FIXED. The hundreds of thousands connections had caused that exception.

yusong
  • 479
  • 2
  • 6
  • 21