Search in sources :

Example 6 with CipherSuite

use of okhttp3.CipherSuite in project okhttp by square.

the class CustomCipherSuites method run.

public void run() throws Exception {
    Request request = new Request.Builder().url("https://publicobject.com/helloworld.txt").build();
    try (Response response = client.newCall(request).execute()) {
        if (!response.isSuccessful())
            throw new IOException("Unexpected code " + response);
        System.out.println(response.handshake().cipherSuite());
        System.out.println(response.body().string());
    }
}
Also used : Response(okhttp3.Response) Request(okhttp3.Request) IOException(java.io.IOException)

Aggregations

Response (okhttp3.Response)5 CipherSuite (okhttp3.CipherSuite)3 Request (okhttp3.Request)3 CacheResponse (java.net.CacheResponse)2 SecureCacheResponse (java.net.SecureCacheResponse)2 Certificate (java.security.cert.Certificate)2 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)2 MockResponse (mockwebserver3.MockResponse)2 Handshake (okhttp3.Handshake)2 Headers (okhttp3.Headers)2 ResponseBody (okhttp3.ResponseBody)2 JavaNetHeaders (okhttp3.internal.JavaNetHeaders)2 CacheRequest (okhttp3.internal.cache.CacheRequest)2 HttpHeaders (okhttp3.internal.http.HttpHeaders)2 StatusLine (okhttp3.internal.http.StatusLine)2 Test (org.junit.jupiter.api.Test)2 IOException (java.io.IOException)1 HttpURLConnection (java.net.HttpURLConnection)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1