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; }
(trustKeyStorePassword).setTrustKeyStoreType(trustKeyStoreType).setClientAuth(true); } else {// if trust keystore is null, use keystore as trust keystore sslConfigBuilder.useKeystoreAsTrustKeyStore();
(trustKeyStorePassword).setTrustKeyStoreType(trustKeyStoreType).setClientAuth(true); } else {// if trust keystore is null, use keystore as trust keystore sslConfigBuilder.useKeystoreAsTrustKeyStore();