Skip to content

Commit 3725b3d

Browse files
committed
Merge pull request square#172 from square/jw/casing
Jw/casing
2 parents bd2cac5 + eb5e722 commit 3725b3d

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change Log
22
==========
33

4+
Version 1.0.1 *(2013-05-06)*
5+
----------------------------
6+
7+
* Correct casing of SSL in method names (`getSslSocketFactory`/`setSslSocketFactory`).
8+
9+
410
Version 1.0.0 *(2013-05-06)*
511
----------------------------
612

okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ private OkResponseCache okResponseCache() {
142142
* <p>If unset, the {@link HttpsURLConnection#getDefaultSSLSocketFactory()
143143
* system-wide default} SSL socket factory will be used.
144144
*/
145-
public OkHttpClient setSSLSocketFactory(SSLSocketFactory sslSocketFactory) {
145+
public OkHttpClient setSslSocketFactory(SSLSocketFactory sslSocketFactory) {
146146
this.sslSocketFactory = sslSocketFactory;
147147
return this;
148148
}
149149

150-
public SSLSocketFactory getSSLSocketFactory() {
150+
public SSLSocketFactory getSslSocketFactory() {
151151
return sslSocketFactory;
152152
}
153153

okhttp/src/main/java/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public HttpURLConnectionImpl(URL url, OkHttpClient client, OkResponseCache respo
114114
this.proxySelector = client.getProxySelector();
115115
this.cookieHandler = client.getCookieHandler();
116116
this.connectionPool = client.getConnectionPool();
117-
this.sslSocketFactory = client.getSSLSocketFactory();
117+
this.sslSocketFactory = client.getSslSocketFactory();
118118
this.hostnameVerifier = client.getHostnameVerifier();
119119
this.transports = client.getTransports();
120120
this.authenticator = client.getAuthenticator();

okhttp/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep
519519
server.enqueue(new MockResponse().setBody("this response comes via HTTPS"));
520520
server.play();
521521

522-
client.setSSLSocketFactory(sslContext.getSocketFactory());
522+
client.setSslSocketFactory(sslContext.getSocketFactory());
523523
client.setHostnameVerifier(new RecordingHostnameVerifier());
524524
HttpURLConnection connection = client.open(server.getUrl("/foo"));
525525

@@ -539,7 +539,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep
539539
SSLSocketFactory clientSocketFactory = sslContext.getSocketFactory();
540540
RecordingHostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
541541

542-
client.setSSLSocketFactory(clientSocketFactory);
542+
client.setSslSocketFactory(clientSocketFactory);
543543
client.setHostnameVerifier(hostnameVerifier);
544544
HttpURLConnection connection = client.open(server.getUrl("/"));
545545
assertContent("this response comes via HTTPS", connection);
@@ -559,12 +559,12 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep
559559
server.play();
560560

561561
// install a custom SSL socket factory so the server can be authorized
562-
client.setSSLSocketFactory(sslContext.getSocketFactory());
562+
client.setSslSocketFactory(sslContext.getSocketFactory());
563563
client.setHostnameVerifier(new RecordingHostnameVerifier());
564564
HttpURLConnection connection1 = client.open(server.getUrl("/"));
565565
assertContent("this response comes via HTTPS", connection1);
566566

567-
client.setSSLSocketFactory(null);
567+
client.setSslSocketFactory(null);
568568
HttpURLConnection connection2 = client.open(server.getUrl("/"));
569569
try {
570570
readAscii(connection2.getInputStream(), Integer.MAX_VALUE);
@@ -579,7 +579,7 @@ private void doUpload(TransferKind uploadKind, WriteKind writeKind) throws Excep
579579
server.enqueue(new MockResponse().setBody("this response comes via SSL"));
580580
server.play();
581581

582-
client.setSSLSocketFactory(sslContext.getSocketFactory());
582+
client.setSslSocketFactory(sslContext.getSocketFactory());
583583
client.setHostnameVerifier(new RecordingHostnameVerifier());
584584
HttpURLConnection connection = client.open(server.getUrl("/foo"));
585585

@@ -675,7 +675,7 @@ private void testConnectViaDirectProxyToHttps(ProxyConfig proxyConfig) throws Ex
675675
server.play();
676676

677677
URL url = server.getUrl("/foo");
678-
client.setSSLSocketFactory(sslContext.getSocketFactory());
678+
client.setSslSocketFactory(sslContext.getSocketFactory());
679679
client.setHostnameVerifier(new RecordingHostnameVerifier());
680680
HttpURLConnection connection = proxyConfig.connect(server, client, url);
681681

@@ -715,7 +715,7 @@ private void testConnectViaHttpProxyToHttps(ProxyConfig proxyConfig) throws Exce
715715
server.play();
716716

717717
URL url = new URL("https://android.com/foo");
718-
client.setSSLSocketFactory(sslContext.getSocketFactory());
718+
client.setSslSocketFactory(sslContext.getSocketFactory());
719719
client.setHostnameVerifier(hostnameVerifier);
720720
HttpURLConnection connection = proxyConfig.connect(server, client, url);
721721

@@ -752,7 +752,7 @@ private void testConnectViaHttpProxyToHttps(ProxyConfig proxyConfig) throws Exce
752752
client.setProxy(server.toProxyAddress());
753753

754754
URL url = new URL("https://android.com/foo");
755-
client.setSSLSocketFactory(sslContext.getSocketFactory());
755+
client.setSslSocketFactory(sslContext.getSocketFactory());
756756
HttpURLConnection connection = client.open(url);
757757

758758
try {
@@ -790,7 +790,7 @@ private void initResponseCache() throws IOException {
790790
client.setProxy(server.toProxyAddress());
791791

792792
URL url = new URL("https://android.com/foo");
793-
client.setSSLSocketFactory(sslContext.getSocketFactory());
793+
client.setSslSocketFactory(sslContext.getSocketFactory());
794794
client.setHostnameVerifier(hostnameVerifier);
795795
HttpURLConnection connection = client.open(url);
796796
connection.addRequestProperty("Private", "Secret");
@@ -822,7 +822,7 @@ private void initResponseCache() throws IOException {
822822
client.setProxy(server.toProxyAddress());
823823

824824
URL url = new URL("https://android.com/foo");
825-
client.setSSLSocketFactory(sslContext.getSocketFactory());
825+
client.setSslSocketFactory(sslContext.getSocketFactory());
826826
client.setHostnameVerifier(new RecordingHostnameVerifier());
827827
HttpURLConnection connection = client.open(url);
828828
assertContent("A", connection);
@@ -852,7 +852,7 @@ private void initResponseCache() throws IOException {
852852
client.setProxy(server.toProxyAddress());
853853

854854
URL url = new URL("https://android.com/foo");
855-
client.setSSLSocketFactory(sslContext.getSocketFactory());
855+
client.setSslSocketFactory(sslContext.getSocketFactory());
856856
client.setHostnameVerifier(new RecordingHostnameVerifier());
857857
HttpURLConnection connection = client.open(url);
858858
connection.setRequestProperty("Connection", "close");
@@ -873,7 +873,7 @@ private void initResponseCache() throws IOException {
873873
client.setProxy(server.toProxyAddress());
874874

875875
URL url = new URL("https://android.com/foo");
876-
client.setSSLSocketFactory(socketFactory);
876+
client.setSslSocketFactory(socketFactory);
877877
client.setHostnameVerifier(hostnameVerifier);
878878
assertContent("response 1", client.open(url));
879879
assertContent("response 2", client.open(url));
@@ -1088,7 +1088,7 @@ private void testClientConfiguredGzipContentEncodingAndConnectionReuse(TransferK
10881088
SSLSocketFactory socketFactory = sslContext.getSocketFactory();
10891089
RecordingHostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
10901090
server.useHttps(socketFactory, false);
1091-
client.setSSLSocketFactory(socketFactory);
1091+
client.setSslSocketFactory(socketFactory);
10921092
client.setHostnameVerifier(hostnameVerifier);
10931093
}
10941094

@@ -1399,7 +1399,7 @@ private void testSecureStreamingPost(StreamingMode streamingMode) throws Excepti
13991399
server.enqueue(new MockResponse().setBody("Success!"));
14001400
server.play();
14011401

1402-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1402+
client.setSslSocketFactory(sslContext.getSocketFactory());
14031403
client.setHostnameVerifier(new RecordingHostnameVerifier());
14041404
HttpURLConnection connection = client.open(server.getUrl("/"));
14051405
connection.setDoOutput(true);
@@ -1533,7 +1533,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc
15331533
server.enqueue(new MockResponse().setBody("This is the new location!"));
15341534
server.play();
15351535

1536-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1536+
client.setSslSocketFactory(sslContext.getSocketFactory());
15371537
client.setHostnameVerifier(new RecordingHostnameVerifier());
15381538
HttpURLConnection connection = client.open(server.getUrl("/"));
15391539
assertEquals("This is the new location!",
@@ -1554,7 +1554,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc
15541554
server.play();
15551555

15561556
client.setFollowProtocolRedirects(false);
1557-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1557+
client.setSslSocketFactory(sslContext.getSocketFactory());
15581558
client.setHostnameVerifier(new RecordingHostnameVerifier());
15591559
HttpURLConnection connection = client.open(server.getUrl("/"));
15601560
assertEquals("This page has moved!", readAscii(connection.getInputStream(), Integer.MAX_VALUE));
@@ -1582,7 +1582,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc
15821582
.setBody("This page has moved!"));
15831583
server.play();
15841584

1585-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1585+
client.setSslSocketFactory(sslContext.getSocketFactory());
15861586
client.setHostnameVerifier(new RecordingHostnameVerifier());
15871587
client.setFollowProtocolRedirects(true);
15881588
HttpsURLConnection connection = (HttpsURLConnection) client.open(server.getUrl("/"));
@@ -1605,7 +1605,7 @@ private void testRedirected(TransferKind transferKind, boolean reuse) throws Exc
16051605
.setBody("This page has moved!"));
16061606
server.play();
16071607

1608-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1608+
client.setSslSocketFactory(sslContext.getSocketFactory());
16091609
client.setHostnameVerifier(new RecordingHostnameVerifier());
16101610
client.setFollowProtocolRedirects(true);
16111611
HttpURLConnection connection = client.open(server.getUrl("/"));
@@ -1626,7 +1626,7 @@ private void redirectToAnotherOriginServer(boolean https) throws Exception {
16261626
if (https) {
16271627
server.useHttps(sslContext.getSocketFactory(), false);
16281628
server2.useHttps(sslContext.getSocketFactory(), false);
1629-
client.setSSLSocketFactory(sslContext.getSocketFactory());
1629+
client.setSslSocketFactory(sslContext.getSocketFactory());
16301630
client.setHostnameVerifier(new RecordingHostnameVerifier());
16311631
}
16321632

@@ -1848,7 +1848,7 @@ private void test307Redirect(String method) throws Exception {
18481848
sc.init(null, new TrustManager[] { trustManager }, new java.security.SecureRandom());
18491849

18501850
client.setHostnameVerifier(hostnameVerifier);
1851-
client.setSSLSocketFactory(sc.getSocketFactory());
1851+
client.setSslSocketFactory(sc.getSocketFactory());
18521852
server.useHttps(sslContext.getSocketFactory(), false);
18531853
server.enqueue(new MockResponse().setBody("ABC"));
18541854
server.enqueue(new MockResponse().setBody("DEF"));

okhttp/src/test/java/com/squareup/okhttp/internal/spdy/HttpOverSpdyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public boolean verify(String hostname, SSLSession session) {
7878
private HttpResponseCache cache;
7979

8080
@Before public void setUp() throws Exception {
81-
client.setSSLSocketFactory(sslContext.getSocketFactory());
81+
client.setSslSocketFactory(sslContext.getSocketFactory());
8282
client.setHostnameVerifier(NULL_HOSTNAME_VERIFIER);
8383
String systemTmpDir = System.getProperty("java.io.tmpdir");
8484
File cacheDir = new File(systemTmpDir, "HttpCache-" + UUID.randomUUID());

0 commit comments

Comments
 (0)