Search in sources :

Example 26 with SecureCacheResponse

use of java.net.SecureCacheResponse in project XobotOS by xamarin.

the class HttpsURLConnectionImpl method getPeerPrincipal.

@Override
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
    SecureCacheResponse cacheResponse = delegate.getCacheResponse();
    if (cacheResponse != null) {
        return cacheResponse.getPeerPrincipal();
    }
    checkConnected();
    return delegate.getSSLSocket().getSession().getPeerPrincipal();
}
Also used : SecureCacheResponse(java.net.SecureCacheResponse)

Example 27 with SecureCacheResponse

use of java.net.SecureCacheResponse in project XobotOS by xamarin.

the class HttpsURLConnectionImpl method getServerCertificates.

@Override
public Certificate[] getServerCertificates() throws SSLPeerUnverifiedException {
    SecureCacheResponse cacheResponse = delegate.getCacheResponse();
    if (cacheResponse != null) {
        List<Certificate> result = cacheResponse.getServerCertificateChain();
        return result != null ? result.toArray(new Certificate[result.size()]) : null;
    }
    checkConnected();
    return delegate.getSSLSocket().getSession().getPeerCertificates();
}
Also used : SecureCacheResponse(java.net.SecureCacheResponse) Certificate(java.security.cert.Certificate)

Aggregations

SecureCacheResponse (java.net.SecureCacheResponse)27 SSLSocket (javax.net.ssl.SSLSocket)15 Certificate (java.security.cert.Certificate)11 CacheResponse (java.net.CacheResponse)6 List (java.util.List)5 Request (okhttp3.Request)5 Response (okhttp3.Response)5 Handshake (okhttp3.Handshake)4 ResponseBody (okhttp3.ResponseBody)4 Test (org.junit.Test)4 Headers (okhttp3.Headers)3 URI (java.net.URI)2 JavaNetHeaders (okhttp3.internal.JavaNetHeaders)2 HttpHeaders (okhttp3.internal.http.HttpHeaders)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Proxy (java.net.Proxy)1 ProxySelector (java.net.ProxySelector)1 Principal (java.security.Principal)1 X509Certificate (java.security.cert.X509Certificate)1 LinkedHashMap (java.util.LinkedHashMap)1