Search in sources :

Example 11 with CertificatePinner

use of okhttp3.CertificatePinner in project okhttp by square.

the class RetryAndFollowUpInterceptor method createAddress.

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());
}
Also used : Address(okhttp3.Address) CertificatePinner(okhttp3.CertificatePinner) SSLSocketFactory(javax.net.ssl.SSLSocketFactory) HostnameVerifier(javax.net.ssl.HostnameVerifier)

Aggregations

Test (org.junit.Test)10 MockResponse (okhttp3.mockwebserver.MockResponse)6 CertificatePinner (okhttp3.CertificatePinner)5 Call (okhttp3.Call)4 Pin (okhttp3.CertificatePinner.Pin)4 OkHttpClient (okhttp3.OkHttpClient)4 RecordingHostnameVerifier (okhttp3.RecordingHostnameVerifier)4 Request (okhttp3.Request)4 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)3 Response (okhttp3.Response)2 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)2 Certificate (java.security.cert.Certificate)1 HostnameVerifier (javax.net.ssl.HostnameVerifier)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1 SSLSocketFactory (javax.net.ssl.SSLSocketFactory)1 Address (okhttp3.Address)1 HeldCertificate (okhttp3.internal.tls.HeldCertificate)1