You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Lyor Goldstein (Jira)" <ji...@apache.org> on 2020/07/22 06:51:00 UTC
[jira] [Commented] (SSHD-1040) get the server key
[ https://issues.apache.org/jira/browse/SSHD-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17162536#comment-17162536 ]
Lyor Goldstein commented on SSHD-1040:
--------------------------------------
The reason for this is
{code:java|title=AbstractSession}
synchronized (pendingPackets) {
pendingWrites = sendPendingPackets(pendingPackets);
kex = null; // discard and GC since KEX is completed
kexState.set(KexState.DONE);
}
{code}
> get the server key
> ------------------
>
> Key: SSHD-1040
> URL: https://issues.apache.org/jira/browse/SSHD-1040
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.2.0, 2.3.0, 2.5.0, 2.4.0, 2.5.1
> Reporter: clem
> Priority: Minor
> Fix For: 2.1.0
>
>
> Hello,
> There's a bug for get the public key of a server from version 2.2.0.
> On the version 2.1.0, it works :
> *Code :*
> {code:java}
> SshClient client = SshClient.setUpDefaultClient();
> client.start();
> ConnectFuture connectFuture = client.connect("xxx", "xxx", 22);
> connectFuture.await(10000);
> ClientSession session = connectFuture.getSession();
> session.waitFor(Arrays.asList(ClientSessionEvent.WAIT_AUTH), 10000);
> System.out.println(session.getKex().getServerKey().toString());
> {code}
> *Result :*
> {noformat}
> Sun RSA public key, 2048 bits
> modulus: xxx
> public exponent: 35{noformat}
>
> *And with a higher version (example 2.5.1), the result is :*
> {noformat}
> Exception in thread "main" java.lang.NullPointerException
> at test.test.main(test.java:27){noformat}
> Line 27 is :
> {code:java}
> System.out.println(session.getKex().getServerKey().toString());
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org