This is not exactly what you need but something that I did to get around a
similar problem:
SshClient client = SshClient.setUpDefaultClient();
// Get the current default list of key exchange factories
List<KeyExchangeFactory> keyExchangeFactories =
client.getKeyExchangeFactories();
// Add the Diffie-Hellman-group1-sha1 key exchange factory
keyExchangeFactories.addAll(NamedFactory.setUpTransformedFactories(
false,
List.of(BuiltinDHFactories.dhg1),
ClientBuilder.DH2KEX
));
// Update the key exchange factories
client.setKeyExchangeFactories(keyExchangeFactories);
// Update ciphers
List<NamedFactory<Cipher>> cipherFactories = client.getCipherFactories();
List<BuiltinCiphers> ciphers = new ArrayList<>();
ciphers.add(BuiltinCiphers.blowfishcbc);
ciphers.add(BuiltinCiphers.tripledescbc);
cipherFactories.addAll(NamedFactory.setUpBuiltinFactories(false, ciphers));
// Update the cipher exchange factories
client.setCipherFactories(cipherFactories);
From: Luciano Moretti <[email protected]>
Date: Friday, March 17, 2023 at 3:19 PM
To: [email protected] <[email protected]>
Subject: How to set ssh-dss, 3des-cbc, diffie_hellman_group1_sha1?
[External email: Use caution with links and attachments]
________________________________
I've got an older device I'm trying to connect to that uses these old
settings.
The main web page indicates that these are supported, but I can't seem to
figure out how to enable them after calling SshClient.setUpDefaultClient()
Digging through the JavaDoc and code for SshClient doesn't make it obvious.
Could someone send me sample code? I looked at Stack Overflow and found
this exact question without an answer as well.
Thanks,
Luciano Moretti
Internal