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; }
throw new IllegalArgumentException(); SSLConfigurationBuilder sslConfigBuilder = SSLConfigurationBuilder.newBuilder(); sslConfigBuilder.setKeyStorePath(keyStorePath).setKeyStorePassword(keyStorePassword) .setKeyStoreType(keyStoreType).setClientAuth(clientAuth);
throw new IllegalArgumentException(); SSLConfigurationBuilder sslConfigBuilder = SSLConfigurationBuilder.newBuilder(); sslConfigBuilder.setKeyStorePath(keyStorePath).setKeyStorePassword(keyStorePassword) .setKeyStoreType(keyStoreType).setClientAuth(clientAuth);