- public void bind(final InetSocketAddress bindingAddress, final LocalAddress localAddress, final PasswordAuthenticator authenticator, final KeyPairProvider keyPairProvider) throws IOException {
- sshServer.setHost(bindingAddress.getHostString());
- sshServer.setPort(bindingAddress.getPort());
-
- sshServer.setPasswordAuthenticator(authenticator);
- sshServer.setKeyPairProvider(keyPairProvider);
+ public void bind(final SshProxyServerConfiguration sshProxyServerConfiguration) throws IOException {
+ sshServer.setHost(sshProxyServerConfiguration.getBindingAddress().getHostString());
+ sshServer.setPort(sshProxyServerConfiguration.getBindingAddress().getPort());
+
+ //remove rc4 ciphers
+ final List<NamedFactory<Cipher>> cipherFactories = sshServer.getCipherFactories();
+ for (Iterator<NamedFactory<Cipher>> i = cipherFactories.iterator(); i.hasNext(); ) {
+ final NamedFactory<Cipher> factory = i.next();
+ if (factory.getName().contains(DEFAULT_ARCFOUR128_FACTORY.getName())
+ || factory.getName().contains(DEFAULT_ARCFOUR256_FACTORY.getName())) {
+ i.remove();
+ }
+ }
+ sshServer.setPasswordAuthenticator(sshProxyServerConfiguration.getAuthenticator());
+ sshServer.setKeyPairProvider(sshProxyServerConfiguration.getKeyPairProvider());