use of okhttp3.internal.tls.SslClient in project okhttp by square.
the class UrlConnection method prepare.
@Override
public void prepare(Benchmark benchmark) {
super.prepare(benchmark);
if (benchmark.tls) {
SslClient sslClient = SslClient.localhost();
SSLSocketFactory socketFactory = sslClient.socketFactory;
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession session) {
return true;
}
};
HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);
HttpsURLConnection.setDefaultSSLSocketFactory(socketFactory);
}
}
use of okhttp3.internal.tls.SslClient in project okhttp by square.
the class CertificateChainCleanerTest method equalsFromTrustManager.
@Test
public void equalsFromTrustManager() throws Exception {
SslClient client = new SslClient.Builder().build();
X509TrustManager x509TrustManager = client.trustManager;
assertEquals(CertificateChainCleaner.get(x509TrustManager), CertificateChainCleaner.get(x509TrustManager));
}
Aggregations