Discussion:
[JSch-users] com.jcraft.jsch.JSchException: verify: false
Fate Testarossa
2015-10-23 02:19:48 UTC
Permalink
Dear sir,
when i use jsch frequently connect and disconnect session,it shows :631com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:295) at com.jcraft.jsch.Session.connect(Session.java:150) at udf.Test1.connect(Test1.java:48) at udf.Test1.main(Test1.java:18)940com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:295) at com.jcraft.jsch.Session.connect(Session.java:150) at udf.Test1.connect(Test1.java:48) at udf.Test1.main(Test1.java:18)
the code is "
import com.jcraft.jsch.ChannelSftp;import com.jcraft.jsch.JSch;import com.jcraft.jsch.JSchException;import com.jcraft.jsch.Session;import com.jcraft.jsch.UserInfo;
public class Test1 {
public static void main(String[] args) { Test1 c =new Test1(); int count =0; while(true){ Session s; try { s = c.connect(); ChannelSftp sftp =(ChannelSftp)s.openChannel("sftp");// sftp.connect();// sftp.disconnect(); c.close(s); count++; if(count==1000000000) System.out.println(count); } catch (JSchException e) { // TODO Auto-generated catch block System.out.println(count); e.printStackTrace(); } } } public void close(ChannelSftp channelSftp){ if(channelSftp!=null||!channelSftp.isConnected()) channelSftp.disconnect(); } public void close(Session session){ if(session!=null||!session.isConnected()) session.disconnect(); } public Session connect() throws JSchException{ Session session =new JSch().getSession("xx", "xx.xx.xx.xx"); session.setUserInfo(new SimpleUserInfo("xxxx")); session.connect(); return session; }}class SimpleUserInfo implements UserInfo {

private String password;
public SimpleUserInfo(String password) { this.password = password; }
@Override public String getPassphrase() { return null; }
@Override public String getPassword() { return password; }
@Override public boolean promptPassword(String message) { return true; }
@Override public boolean promptPassphrase(String message) { return false; }
@Override public boolean promptYesNo(String message) { return true; }
@Override public void showMessage(String s) {
}}

"And when i also connect and disconnect channelsftp frequently ,the message shows that "125com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:295) at com.jcraft.jsch.Session.connect(Session.java:150) at udf.Test1.connect(Test1.java:49) at udf.Test1.main(Test1.java:19)
"the code is "
import com.jcraft.jsch.ChannelSftp;import com.jcraft.jsch.JSch;import com.jcraft.jsch.JSchException;import com.jcraft.jsch.Session;import com.jcraft.jsch.UserInfo;
public class Test1 {
public static void main(String[] args) { Test1 c =new Test1(); int count =0; while(true){ Session s; try { s = c.connect(); ChannelSftp sftp =(ChannelSftp)s.openChannel("sftp"); sftp.connect(); sftp.disconnect(); c.close(s); count++; if(count==1000000000) System.out.println(count); } catch (JSchException e) { // TODO Auto-generated catch block System.out.println(count); e.printStackTrace(); } } } public void close(ChannelSftp channelSftp){ if(channelSftp!=null||!channelSftp.isConnected()) channelSftp.disconnect(); } public void close(Session session){ if(session!=null||!session.isConnected()) session.disconnect(); } public Session connect() throws JSchException{ Session session =new JSch().getSession("xxx", "xx.xx.xx.xx"); session.setUserInfo(new SimpleUserInfo("xxxxx")); session.connect(); return session; }}class SimpleUserInfo implements UserInfo {

private String password;
public SimpleUserInfo(String password) { this.password = password; }
@Override public String getPassphrase() { return null; }
@Override public String getPassword() { return password; }
@Override public boolean promptPassword(String message) { return true; }
@Override public boolean promptPassphrase(String message) { return false; }
@Override public boolean promptYesNo(String message) { return true; }
@Override public void showMessage(String s) {
}}
"
Then how to do it if i want to connect and disconnect session and channelsftp frequently ? Thanks.
Lothar Kimmeringer
2015-10-25 23:36:58 UTC
Permalink
Post by Fate Testarossa
com.jcraft.jsch.JSchException: verify: false
at com.jcraft.jsch.Session.connect(Session.java:295)
[...]
Post by Fate Testarossa
And when i also connect and disconnect channelsftp frequently ,
the message shows that "
com.jcraft.jsch.JSchException: verify: false
at com.jcraft.jsch.Session.connect(Session.java:295)
This is the same error. You don't reach the line where
you open sftp.
Post by Fate Testarossa
Then how to do it if i want to connect and disconnect session
and channelsftp frequently ? Thanks.
Looks like there is a firewall on the server-side (or a
feature in the SSH-server) regarding your client's
behavior as DoS-attack and denies further access.


Cheers, Lothar

------------------------------------------------------------------------------
Loading...