if (proxySslValue != null) { proxy = new SSLSocks5(new InetSocketAddress(host, port), SSLConfiguration.load (proxySslValue));
if (proxySslValue != null) { proxy = new SSLSocks5(new InetSocketAddress(host, port), SSLConfiguration.load (proxySslValue));
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]); configuration = new SSLConfiguration(null, trustKeyStoreInfo); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password)); keyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[6]), values[7]); configuration = new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password));
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]); configuration = new SSLConfiguration(null, trustKeyStoreInfo); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password)); keyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[6]), values[7]); configuration = new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password));
private SocksProxy initProxySSL(Arguments arguments, SocksServerBuilder builder, SocketAddress address) throws IllegalArgumentException { String keystorePath = arguments.getValue("-pk", null); String keystorePassword = arguments.getValue("-pw", null); String keystoreType = arguments.getValue("-pt", KEY_STORE_TYPE); if (keystorePath != null) { if (keystorePassword == null) { logger.info("Need password for keystore:{}", keystorePath); throw new IllegalArgumentException(); } SSLConfigurationBuilder sslConfigurationBuilder = SSLConfigurationBuilder.newBuilder(); sslConfigurationBuilder.setKeyStorePath(keystorePath).setKeyStorePassword(keystorePassword) .setKeyStoreType(keystoreType).useKeystoreAsTrustKeyStore(); return new SSLSocks5(address, sslConfigurationBuilder.build()); } return null; }
private SocksProxy initProxySSL(Arguments arguments, SocksServerBuilder builder, SocketAddress address) throws IllegalArgumentException { String keystorePath = arguments.getValue("-pk", null); String keystorePassword = arguments.getValue("-pw", null); String keystoreType = arguments.getValue("-pt", KEY_STORE_TYPE); if (keystorePath != null) { if (keystorePassword == null) { logger.info("Need password for keystore:{}", keystorePath); throw new IllegalArgumentException(); } SSLConfigurationBuilder sslConfigurationBuilder = SSLConfigurationBuilder.newBuilder(); sslConfigurationBuilder.setKeyStorePath(keystorePath).setKeyStorePassword(keystorePassword) .setKeyStoreType(keystoreType).useKeystoreAsTrustKeyStore(); return new SSLSocks5(address, sslConfigurationBuilder.build()); } return null; }
@Override public SocksProxy copyWithoutChainProxy() { SSLSocks5 socks5 = new SSLSocks5(getInetAddress(), getPort(), configuration); socks5.setAcceptableMethods(getAcceptableMethods()).setAlwaysResolveAddressLocally (isAlwaysResolveAddressLocally()).setCredentials(getCredentials()).setInetAddress (getInetAddress()).setPort(getPort()).setSocksMethodRequester(getSocksMethodRequester()); return socks5; }
@Override public SocksProxy copyWithoutChainProxy() { SSLSocks5 socks5 = new SSLSocks5(getInetAddress(), getPort(), configuration); socks5.setAcceptableMethods(getAcceptableMethods()).setAlwaysResolveAddressLocally (isAlwaysResolveAddressLocally()).setCredentials(getCredentials()).setInetAddress (getInetAddress()).setPort(getPort()).setSocksMethodRequester(getSocksMethodRequester()); return socks5; }