Closed swathimr closed 3 months ago
You have a bug in your code.
The lines where you are calling JSch.setConfig("server_host_key", ...)
and JSch.setConfig("PubkeyAcceptedAlgorithms", ...)
, you are constantly appending ,ssh-rsa,ssh-dss
over and over to them every time you call your getConnection()
method.
JSch.setConfig() are static methods that act on global static state. If you need to change this on a per-session basis, then you should use session.setConfig(), so that it doesn't constantly change global static state.
okay I will try that. Does this issue occur only with the heavy load or multiple connects ?
Hi @swathimr,
This has nothing to do with heavy load or multiple connects: your code is simply flawed.
Thanks, Jeremy
I am using JSCH to connect to SFTP with high traffic and recently updated the library from com.jcraft. We saw this error recently and in local environment I am not able to reproduce the issue.
Can you please let me know whats causing this ?