@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
public HttpsClient(String host, String project) { SslConfigurator sslConfig = SslConfigurator.newInstance(); SSLContext ssl = sslConfig.createSSLContext(); this.target = ClientBuilder.newBuilder().sslContext(ssl).build().target(UriBuilder.fromUri("https://" + host).build()); if (project != null) { this.target = this.target.path(project); } }
.keyPassword("asdfgh"); final Client client = ClientBuilder.newBuilder().sslContext(sslConfig.createSSLContext()).build(); client.property(ClientProperties.CONNECT_TIMEOUT, 2000) .register(new MoxyJsonFeature())
private static Client initializeClient(DirectoryServerConfiguration directoryServerConfiguration) throws CertificateException { KeyStore trustStore = initializeKeyStore(directoryServerConfiguration.getReplicationCaCertificate()); SSLContext sslContext = SslConfigurator.newInstance() .securityProtocol("TLSv1.2") .trustStore(trustStore) .createSSLContext(); return ClientBuilder.newBuilder() .register(HttpAuthenticationFeature.basic("signal", directoryServerConfiguration.getReplicationPassword().getBytes())) .sslContext(sslContext) .build(); }
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
static PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); static Client client; static{ connectionManager.setMaxTotal(100); connectionManager.setDefaultMaxPerRoute(10); //you can provide per route settings //connectionManager.setMaxPerRoute(new HttpRoute(new HttpHost("localhost")), 40); SslConfigurator sslConfig = SslConfigurator.newInstance() .securityProtocol("TLS") .keyStoreFile("/path") .keyStorePassword("password") .keyStoreType("JKS") .trustStoreFile("/path"); ClientConfig clientConfig = new ClientConfig(); clientConfig.property(ApacheClientProperties.CONNECTION_MANAGER, connectionManager); clientConfig.connectorProvider(new ApacheConnectorProvider()); client = ClientBuilder.newBuilder().withConfig(clientConfig).sslContext(sslConfig.createSSLContext()).build(); }
@Override protected Client createJerseyClient() throws Exception { SslConfigurator sslConfig = SslConfigurator.newInstance() .trustStoreFile(getResourcePath("bookie.truststore.jks")); SSLContext sslContext = sslConfig.createSSLContext(); return ClientBuilder.newBuilder().sslContext(sslContext) .hostnameVerifier((s1, s2) -> true) .build(); }
public static Client buildClient(RestClientConfig clientConfig) { Client client; if (clientConfig.isDisabledSecureConnection()) { client = ClientBuilder.newBuilder().build(); } else { SslConfigurator sslConfig = SslConfigurator.newInstance() .trustStore(getTrustStore()) .trustStorePassword(getTrustStorePassword()) .securityProtocol(TLSV1_2); SSLContext sslContext = sslConfig.createSSLContext(); client = ClientBuilder.newBuilder().sslContext(sslContext).build(); } client.register(RestClientLoggingFilter.class); return client; }