1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-24 18:41:06 +03:00

Rename SslClient to TlsNode and make it a public API

https://github.com/square/okhttp/issues/3934
This commit is contained in:
Jesse Wilson
2018-07-08 15:33:16 -04:00
parent 44c2696932
commit 31c511f694
30 changed files with 669 additions and 487 deletions

View File

@@ -32,10 +32,10 @@ import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.mockwebserver.internal.tls.SslClient;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.TlsNode;
import okio.Buffer;
import okio.BufferedSink;
import okio.ByteString;
@@ -44,6 +44,7 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static okhttp3.mockwebserver.internal.tls.TlsUtil.localhost;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -57,7 +58,7 @@ public final class HttpLoggingInterceptorTest {
@Rule public final MockWebServer server = new MockWebServer();
private SslClient sslClient = SslClient.localhost();
private TlsNode tlsNode = localhost();
private HostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
private OkHttpClient client;
private String host;
@@ -80,7 +81,7 @@ public final class HttpLoggingInterceptorTest {
client = new OkHttpClient.Builder()
.addNetworkInterceptor(networkInterceptor)
.addInterceptor(applicationInterceptor)
.sslSocketFactory(sslClient.socketFactory, sslClient.trustManager)
.sslSocketFactory(tlsNode.sslSocketFactory(), tlsNode.trustManager())
.hostnameVerifier(hostnameVerifier)
.build();
@@ -723,7 +724,7 @@ public final class HttpLoggingInterceptorTest {
}
@Test public void http2() throws Exception {
server.useHttps(sslClient.socketFactory, false);
server.useHttps(tlsNode.sslSocketFactory(), false);
url = server.url("/");
setLevel(Level.BASIC);