j2ssh を使用して、アプリケーションからサーバーにファイルを SCP しようとしています。リモート サーバーは TECTIA を実行しています。
コマンド ライン (私のアプリがデプロイされている Solaris マシン) から、scp は交換したキー ペアを使用して正常に動作します。
私のアプリケーションから、j2ssh は接続を確立できず、例外がスローされます。
Caused by: com.sshtools.j2ssh.transport.TransportProtocolException: The connection did not complete
j2ssh からのデバッグ ログには、次のように表示されます。
com.sshtools.j2ssh.transport.TransportProtocolCommon.beginKeyExchange(Unknown Source) | Starting key exchange
com.sshtools.j2ssh.transport.TransportProtocolCommon.determineAlgorithm(Unknown Source) | Determine Algorithm
com.sshtools.j2ssh.transport.TransportProtocolCommon.determineAlgorithm(Unknown Source) | Client Algorithms: [diffie-hellman-group1-sha1]
com.sshtools.j2ssh.transport.TransportProtocolCommon.determineAlgorithm(Unknown Source) | Server Algorithms: [diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1]
com.sshtools.j2ssh.transport.TransportProtocolCommon.sendMessage(Unknown Source) | Sending SSH_MSG_DISCONNECT
com.sshtools.j2ssh.transport.TransportProtocolCommon.run(Unknown Source) | The Transport Protocol has been stopped
上記から、アプリとサーバー間のキー交換に一致するアルゴリズムがないことがわかります(実際にデバッグすると、この問題の根本はAlgorithmNotAgreedException
サーバーとクライアントのアルゴリズムが一致しない場合にあるため、これが根本的な原因であることがわかります)。
新しいアルゴリズムを j2ssh に追加して、一致するものを見つけられるようにするにはどうすればよいですか? j2ssh のドキュメントはかなりまばらです。