diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5339961690..2f99c4704eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Change Log ========== +Version 1.0.1 *(2013-05-06)* +---------------------------- + + * Correct casing of SSL in method names (`getSslSocketFactory`/`setSslSocketFactory`). + + Version 1.0.0 *(2013-05-06)* ---------------------------- diff --git a/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java b/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java index f0b40ab1cef6..da3e82c5403d 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java +++ b/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java @@ -142,12 +142,12 @@ private OkResponseCache okResponseCache() { *

If unset, the {@link HttpsURLConnection#getDefaultSSLSocketFactory() * system-wide default} SSL socket factory will be used. */ - public OkHttpClient setSSLSocketFactory(SSLSocketFactory sslSocketFactory) { + public OkHttpClient setSslSocketFactory(SSLSocketFactory sslSocketFactory) { this.sslSocketFactory = sslSocketFactory; return this; } - public SSLSocketFactory getSSLSocketFactory() { + public SSLSocketFactory getSslSocketFactory() { return sslSocketFactory; } diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java b/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java index 07bde4a65a9f..ee73c7fa3d00 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java +++ b/okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java @@ -114,7 +114,7 @@ public HttpURLConnectionImpl(URL url, OkHttpClient client, OkResponseCache respo this.proxySelector = client.getProxySelector(); this.cookieHandler = client.getCookieHandler(); this.connectionPool = client.getConnectionPool(); - this.sslSocketFactory = client.getSSLSocketFactory(); + this.sslSocketFactory = client.getSslSocketFactory(); this.hostnameVerifier = client.getHostnameVerifier(); this.transports = client.getTransports(); this.authenticator = client.getAuthenticator(); diff --git a/okhttp/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java b/okhttp/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java index 827648ad3240..7f6651955dda 100644 --- a/okhttp/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java +++ b/okhttp/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java @@ -519,7 +519,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep server.enqueue(new MockResponse().setBody("this response comes via HTTPS")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(server.getUrl("/foo")); @@ -539,7 +539,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep SSLSocketFactory clientSocketFactory = sslContext.getSocketFactory(); RecordingHostnameVerifier hostnameVerifier = new RecordingHostnameVerifier(); - client.setSSLSocketFactory(clientSocketFactory); + client.setSslSocketFactory(clientSocketFactory); client.setHostnameVerifier(hostnameVerifier); HttpURLConnection connection = client.open(server.getUrl("/")); assertContent("this response comes via HTTPS", connection); @@ -559,12 +559,12 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep server.play(); // install a custom SSL socket factory so the server can be authorized - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection1 = client.open(server.getUrl("/")); assertContent("this response comes via HTTPS", connection1); - client.setSSLSocketFactory(null); + client.setSslSocketFactory(null); HttpURLConnection connection2 = client.open(server.getUrl("/")); try { readAscii(connection2.getInputStream(), Integer.MAX_VALUE); @@ -579,7 +579,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep server.enqueue(new MockResponse().setBody("this response comes via SSL")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(server.getUrl("/foo")); @@ -675,7 +675,7 @@ private void testConnectViaDirectProxyToHttps(ProxyConfig proxyConfig) throws Ex server.play(); URL url = server.getUrl("/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = proxyConfig.connect(server, client, url); @@ -715,7 +715,7 @@ private void testConnectViaHttpProxyToHttps(ProxyConfig proxyConfig) throws Exce server.play(); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(hostnameVerifier); HttpURLConnection connection = proxyConfig.connect(server, client, url); @@ -752,7 +752,7 @@ private void testConnectViaHttpProxyToHttps(ProxyConfig proxyConfig) throws Exce client.setProxy(server.toProxyAddress()); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); HttpURLConnection connection = client.open(url); try { @@ -790,7 +790,7 @@ private void initResponseCache() throws IOException { client.setProxy(server.toProxyAddress()); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(hostnameVerifier); HttpURLConnection connection = client.open(url); connection.addRequestProperty("Private", "Secret"); @@ -822,7 +822,7 @@ private void initResponseCache() throws IOException { client.setProxy(server.toProxyAddress()); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(url); assertContent("A", connection); @@ -852,7 +852,7 @@ private void initResponseCache() throws IOException { client.setProxy(server.toProxyAddress()); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(url); connection.setRequestProperty("Connection", "close"); @@ -873,7 +873,7 @@ private void initResponseCache() throws IOException { client.setProxy(server.toProxyAddress()); URL url = new URL("https://android.com/foo"); - client.setSSLSocketFactory(socketFactory); + client.setSslSocketFactory(socketFactory); client.setHostnameVerifier(hostnameVerifier); assertContent("response 1", client.open(url)); assertContent("response 2", client.open(url)); @@ -1088,7 +1088,7 @@ private void testClientConfiguredGzipContentEncodingAndConnectionReuse(TransferK SSLSocketFactory socketFactory = sslContext.getSocketFactory(); RecordingHostnameVerifier hostnameVerifier = new RecordingHostnameVerifier(); server.useHttps(socketFactory, false); - client.setSSLSocketFactory(socketFactory); + client.setSslSocketFactory(socketFactory); client.setHostnameVerifier(hostnameVerifier); } @@ -1399,7 +1399,7 @@ private void testSecureStreamingPost(StreamingMode streamingMode) throws Excepti server.enqueue(new MockResponse().setBody("Success!")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(server.getUrl("/")); connection.setDoOutput(true); @@ -1533,7 +1533,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc server.enqueue(new MockResponse().setBody("This is the new location!")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(server.getUrl("/")); assertEquals("This is the new location!", @@ -1554,7 +1554,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc server.play(); client.setFollowProtocolRedirects(false); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); HttpURLConnection connection = client.open(server.getUrl("/")); assertEquals("This page has moved!", readAscii(connection.getInputStream(), Integer.MAX_VALUE)); @@ -1582,7 +1582,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc .setBody("This page has moved!")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); client.setFollowProtocolRedirects(true); HttpsURLConnection connection = (HttpsURLConnection) client.open(server.getUrl("/")); @@ -1605,7 +1605,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc .setBody("This page has moved!")); server.play(); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); client.setFollowProtocolRedirects(true); HttpURLConnection connection = client.open(server.getUrl("/")); @@ -1626,7 +1626,7 @@ private void redirectToAnotherOriginServer(boolean https) throws Exception { if (https) { server.useHttps(sslContext.getSocketFactory(), false); server2.useHttps(sslContext.getSocketFactory(), false); - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(new RecordingHostnameVerifier()); } @@ -1848,7 +1848,7 @@ private void test307Redirect(String method) throws Exception { sc.init(null, new TrustManager[] { trustManager }, new java.security.SecureRandom()); client.setHostnameVerifier(hostnameVerifier); - client.setSSLSocketFactory(sc.getSocketFactory()); + client.setSslSocketFactory(sc.getSocketFactory()); server.useHttps(sslContext.getSocketFactory(), false); server.enqueue(new MockResponse().setBody("ABC")); server.enqueue(new MockResponse().setBody("DEF")); diff --git a/okhttp/src/test/java/com/squareup/okhttp/internal/spdy/HttpOverSpdyTest.java b/okhttp/src/test/java/com/squareup/okhttp/internal/spdy/HttpOverSpdyTest.java index a17cec89c343..597008839135 100644 --- a/okhttp/src/test/java/com/squareup/okhttp/internal/spdy/HttpOverSpdyTest.java +++ b/okhttp/src/test/java/com/squareup/okhttp/internal/spdy/HttpOverSpdyTest.java @@ -78,7 +78,7 @@ public boolean verify(String hostname, SSLSession session) { private HttpResponseCache cache; @Before public void setUp() throws Exception { - client.setSSLSocketFactory(sslContext.getSocketFactory()); + client.setSslSocketFactory(sslContext.getSocketFactory()); client.setHostnameVerifier(NULL_HOSTNAME_VERIFIER); String systemTmpDir = System.getProperty("java.io.tmpdir"); File cacheDir = new File(systemTmpDir, "HttpCache-" + UUID.randomUUID());