@Override public SSLSocketFactory getSSLSocketFactory() { return delegate.client.sslSocketFactory(); }
@Test public void build_with_custom_sslSocketFactory() { SSLSocketFactory sslSocketFactory = mock(SSLSocketFactory.class); OkHttpClient okHttpClient = underTest .setSSLSocketFactory(sslSocketFactory) .build(); assertThat(okHttpClient.sslSocketFactory()).isEqualTo(sslSocketFactory); }
@Test public void build_default_instance_of_OkHttpClient() { OkHttpClient okHttpClient = underTest.build(); assertThat(okHttpClient.proxy()).isNull(); assertThat(okHttpClient.networkInterceptors()).hasSize(1); assertThat(okHttpClient.sslSocketFactory()).isNotNull(); }
@Test public void support_tls_versions_of_java8() { underTest = HttpConnector.newBuilder().url(serverUrl).build(); assertTlsAndClearTextSpecifications(underTest); assertThat(underTest.okHttpClient().sslSocketFactory()).isInstanceOf(SSLSocketFactory.getDefault().getClass()); }
private Address createAddress(HttpUrl url) { SSLSocketFactory sslSocketFactory = null; HostnameVerifier hostnameVerifier = null; CertificatePinner certificatePinner = null; if (url.isHttps()) { sslSocketFactory = client.sslSocketFactory(); hostnameVerifier = client.hostnameVerifier(); certificatePinner = client.certificatePinner(); } return new Address(url.host(), url.port(), client.dns(), client.socketFactory(), sslSocketFactory, hostnameVerifier, certificatePinner, client.proxyAuthenticator(), client.proxy(), client.protocols(), client.connectionSpecs(), client.proxySelector()); }
private Address createAddress(HttpUrl url) { SSLSocketFactory sslSocketFactory = null; HostnameVerifier hostnameVerifier = null; CertificatePinner certificatePinner = null; if (url.isHttps()) { sslSocketFactory = client.sslSocketFactory(); hostnameVerifier = client.hostnameVerifier(); certificatePinner = client.certificatePinner(); } return new Address(url.host(), url.port(), client.dns(), client.socketFactory(), sslSocketFactory, hostnameVerifier, certificatePinner, client.proxyAuthenticator(), client.proxy(), client.protocols(), client.connectionSpecs(), client.proxySelector()); }
@Override public SSLSocketFactory getSSLSocketFactory() { return delegate.client.sslSocketFactory(); }
@Override public SSLSocketFactory sslSocketFactory() { return delegate.sslSocketFactory(); }
@Override public SSLSocketFactory sslSocketFactory() { return delegate.sslSocketFactory(); }
@Override public SSLSocketFactory sslSocketFactory() { return delegate.sslSocketFactory(); }
@Override public SSLSocketFactory getSSLSocketFactory() { return delegate.client.sslSocketFactory(); }
@Override public SSLSocketFactory getSSLSocketFactory() { return delegate.client.sslSocketFactory(); }
testSslSocket = (SSLSocket) testOkHttpClient.sslSocketFactory().createSocket();
private static Address createAddress(OkHttpClient client, Request request) { SSLSocketFactory sslSocketFactory = null; HostnameVerifier hostnameVerifier = null; CertificatePinner certificatePinner = null; if (request.isHttps()) { sslSocketFactory = client.sslSocketFactory(); hostnameVerifier = client.hostnameVerifier(); certificatePinner = client.certificatePinner(); } return new Address(request.url().host(), request.url().port(), client.dns(), client.socketFactory(), sslSocketFactory, hostnameVerifier, certificatePinner, client.proxyAuthenticator(), client.proxy(), client.protocols(), client.connectionSpecs(), client.proxySelector()); } }
private Address createAddress(HttpUrl url) { SSLSocketFactory sslSocketFactory = null; HostnameVerifier hostnameVerifier = null; CertificatePinner certificatePinner = null; if (url.isHttps()) { sslSocketFactory = client.sslSocketFactory(); hostnameVerifier = client.hostnameVerifier(); certificatePinner = client.certificatePinner(); } return new Address(url.host(), url.port(), client.dns(), client.socketFactory(), sslSocketFactory, hostnameVerifier, certificatePinner, client.proxyAuthenticator(), client.proxy(), client.protocols(), client.connectionSpecs(), client.proxySelector()); }
private Address createAddress(HttpUrl url) { SSLSocketFactory sslSocketFactory = null; HostnameVerifier hostnameVerifier = null; CertificatePinner certificatePinner = null; if (url.isHttps()) { sslSocketFactory = client.sslSocketFactory(); hostnameVerifier = client.hostnameVerifier(); certificatePinner = client.certificatePinner(); } return new Address(url.host(), url.port(), client.dns(), client.socketFactory(), sslSocketFactory, hostnameVerifier, certificatePinner, client.proxyAuthenticator(), client.proxy(), client.protocols(), client.connectionSpecs(), client.proxySelector()); }