您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關如何解決jsch客戶端與sshd服務端建鏈異常,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
如下異常,提示加密算法不滿足密鑰尺寸。
從外網找到原因如下,可能會是下面的。jdk兩端版本不一致可能會報此類錯誤。但實際上我是用本地一樣的jdk都是1.8-u191版本,仔細看一下,報錯的線程棧打印的是DSA的加密算法,隨后改了下服務端使用RSA并指定密鑰長度為2048,之后就可以了。
The error message means, that the key likely has 1024 bits strength, because it had been generated with any JDK version before JDK 8u151 - while at least 2048 bits key-strength are being expected: The security strength of SHA-1 digest algorithm is not sufficient for this key size. The reason behind this is, that the default key-size had changed from 1024 to 2048 bits with JDK 8u151. This change can also be found in the JRE/JDK crypto roadmap at datecode 2017-10-17: Upgraded the jarsigner and keytool ?sigalg default to SHA256withDSA and the ?keysize default to 2048 for DSA keys. The "Reverting Instructions" would be (which do not really apply for signage with Android Studio): To use a different algorithm and/or smaller key size use the ?sigalg and ?keysize options of keytool and jarsigner to override the current defaults. Before this change the default values were SHA1withDSA and 1024 bits.
[org.apache.sshd.server.session.ServerSession] : Exception caught java.security.InvalidKeyException: The security strength of SHA-1 digest algorithm is not sufficient for this key size at sun.security.provider.DSA.checkKey(DSA.java:111) at sun.security.provider.DSA.engineInitSign(DSA.java:143) at java.security.Signature$Delegate.engineInitSign(Signature.java:1177) at java.security.Signature.initSign(Signature.java:530) at org.apache.sshd.common.signature.AbstractSignature.init(AbstractSignature.java:47) at org.apache.sshd.server.kex.AbstractDHGServer.next(AbstractDHGServer.java:93) at org.apache.sshd.server.session.ServerSession.handleMessage(ServerSession.java:177) at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:587) at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:253) at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54) at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:231) at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217) at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) at sun.nio.ch.Invoker$2.run(Invoker.java:218) at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
上述就是小編為大家分享的如何解決jsch客戶端與sshd服務端建鏈異常了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。