hierynomus / sshj

ssh, scp and sftp for java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSHJ usage on Android app in Kotlin

StanRichie opened this issue · comments

Hi, I am developing Android app, written in Kotlin, and I get the 'net.schmizz.sshj.common.SSHException: no such algorithm: X25519 for provider BC' error while trying to connect to an SSH server on remote local host. I discovered this article from 2018 -> https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html I am targeting API 34. I was testing this library in Android 14, and Android 10 (API 29). Can you confirm, that SSHJ is not usable in Android apps as of right now?

@StanRichie This issue sounds similar to the problems reported in issue #895.

In that case, the runtime version of Bouncy Castle was not new enough, resulting in the failures described. As you noted in the referenced blog, Android has made some changes in their cryptographic security provider configuration. This might be related, but as a starting point, I recommend checking the dependency tree to confirm that the compiled binary includes a recent version of Bouncy Castle. There are some different configuration classes in SSHJ to control security provider registration, so that may be a next step for evaluation.

Hi,
I ran into the same issue and found a method that fixed it by removing and reinserting the BouncyCastle provider: setupBouncyCastle()