private void checkDefaultConfiguration(SshConfiguration configuration) { if (configuration == null) { if (supportsDefaultConfiguration) { return; } else { throw new UnsupportedOperationException("Default configuration is not supported. You must supply a configuration."); } } configuration.providerHasCapabilities(this); check(configuration.getPreferredClientToServerCipher(), getSupportedCiphers(configuration.getProtocolVersion())); check(configuration.getPreferredServerToClientCipher(), getSupportedCiphers(configuration.getProtocolVersion())); check(configuration.getPreferredClientToServerMAC(), getSupportedMAC()); check(configuration.getPreferredServerToClientMAC(), getSupportedMAC()); check(configuration.getPreferredClientToServerCompression(), getSupportedCompression()); check(configuration.getPreferredServerToClientCompression(), getSupportedCompression()); if (configuration.getProxyServer() != null) { SshProxyServerDetails proxy = configuration.getProxyServer(); if (proxy.getType().equals(SshProxyServerDetails.Type.HTTP) && !getCapabilities().contains(Capability.HTTP_PROXY)) { throw new UnsupportedOperationException("HTTP proxy is not supported."); } if (proxy.getType().equals(SshProxyServerDetails.Type.SOCKS4) && !getCapabilities().contains(Capability.SOCKS4_PROXY)) { throw new UnsupportedOperationException("SOCKS4 proxy is not supported."); } if (proxy.getType().equals(SshProxyServerDetails.Type.SOCKS5) && !getCapabilities().contains(Capability.SOCKS5_PROXY)) { throw new UnsupportedOperationException("SOCKS5 proxy is not supported."); } } }
private void checkDefaultConfiguration(SshConfiguration configuration) { if (configuration == null) { if (supportsDefaultConfiguration) { return; } else { throw new UnsupportedOperationException("Default configuration is not supported. You must supply a configuration."); } } configuration.providerHasCapabilities(this); check(configuration.getPreferredClientToServerCipher(), getSupportedCiphers(configuration.getProtocolVersion())); check(configuration.getPreferredServerToClientCipher(), getSupportedCiphers(configuration.getProtocolVersion())); check(configuration.getPreferredClientToServerMAC(), getSupportedMAC()); check(configuration.getPreferredServerToClientMAC(), getSupportedMAC()); check(configuration.getPreferredClientToServerCompression(), getSupportedCompression()); check(configuration.getPreferredServerToClientCompression(), getSupportedCompression()); if (configuration.getProxyServer() != null) { SshProxyServerDetails proxy = configuration.getProxyServer(); if (proxy.getType().equals(SshProxyServerDetails.Type.HTTP) && !getCapabilities().contains(Capability.HTTP_PROXY)) { throw new UnsupportedOperationException("HTTP proxy is not supported."); } if (proxy.getType().equals(SshProxyServerDetails.Type.SOCKS4) && !getCapabilities().contains(Capability.SOCKS4_PROXY)) { throw new UnsupportedOperationException("SOCKS4 proxy is not supported."); } if (proxy.getType().equals(SshProxyServerDetails.Type.SOCKS5) && !getCapabilities().contains(Capability.SOCKS5_PROXY)) { throw new UnsupportedOperationException("SOCKS5 proxy is not supported."); } } }
SshProxyServerDetails proxyServer = configuration.getProxyServer(); if (proxyServer != null) { connection = new Connection(hostname, port, new HTTPProxyData(
SshProxyServerDetails proxyServer = configuration.getProxyServer(); if (proxyServer != null) { if (proxyServer.getType().equals(SshProxyServerDetails.Type.HTTP)) {