summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-11-21 16:48:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-21 16:48:07 +0000
commitfdaf90ab1738bb4c9368ff1628600b5a1a768860 (patch)
treef7878c5ed0003b0d63e3cd569e11c377f757c141
parent3d8b8972ae0f5bc4c63964fbfad3b9e03463ce50 (diff)
parentce0ccd0299a8c23666a630afa4e440963e457615 (diff)
downloadlibcore-fdaf90ab1738bb4c9368ff1628600b5a1a768860.zip
libcore-fdaf90ab1738bb4c9368ff1628600b5a1a768860.tar.gz
libcore-fdaf90ab1738bb4c9368ff1628600b5a1a768860.tar.bz2
Merge "Fixes associated with OkHttp fallback changes"
-rw-r--r--luni/src/test/java/libcore/java/net/URLConnectionTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index 714df2c..a94f0be 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -2192,13 +2192,10 @@ public final class URLConnectionTest extends AbstractResourceLeakageDetectorTest
public void testSslFallback() throws Exception {
TestSSLContext testSSLContext = TestSSLContext.create();
- // Android now disables SSLv3 by default. To test fallback we re-enable it for the server.
- // This can be removed once OkHttp is updated to support other fallback protocols.
SSLSocketFactory serverSocketFactory =
new LimitedProtocolsSocketFactory(
testSSLContext.serverContext.getSocketFactory(),
"TLSv1", "SSLv3");
-
server.useHttps(serverSocketFactory, false);
server.enqueue(new MockResponse().setSocketPolicy(FAIL_HANDSHAKE));
server.enqueue(new MockResponse().setBody("This required a 2nd handshake"));
@@ -2208,7 +2205,9 @@ public final class URLConnectionTest extends AbstractResourceLeakageDetectorTest
// Keeps track of the client sockets created so that we can interrogate them.
final boolean disableFallbackScsv = true;
FallbackTestClientSocketFactory clientSocketFactory = new FallbackTestClientSocketFactory(
- testSSLContext.clientContext.getSocketFactory(), disableFallbackScsv);
+ new LimitedProtocolsSocketFactory(
+ testSSLContext.clientContext.getSocketFactory(), "TLSv1", "SSLv3"),
+ disableFallbackScsv);
connection.setSSLSocketFactory(clientSocketFactory);
assertEquals("This required a 2nd handshake",
readAscii(connection.getInputStream(), Integer.MAX_VALUE));
@@ -2224,14 +2223,14 @@ public final class URLConnectionTest extends AbstractResourceLeakageDetectorTest
(TlsFallbackDisabledScsvSSLSocket) createdSockets.get(0);
List<String> clientSocket1EnabledProtocols = Arrays.asList(
clientSocket1.getEnabledProtocols());
- assertContains(clientSocket1EnabledProtocols, "TLSv1.2");
+ assertContains(clientSocket1EnabledProtocols, "TLSv1");
assertFalse(clientSocket1.wasTlsFallbackScsvSet());
TlsFallbackDisabledScsvSSLSocket clientSocket2 =
(TlsFallbackDisabledScsvSSLSocket) createdSockets.get(1);
List<String> clientSocket2EnabledProtocols =
Arrays.asList(clientSocket2.getEnabledProtocols());
- assertContainsNoneMatching(clientSocket2EnabledProtocols, "TLSv1.2");
+ assertContainsNoneMatching(clientSocket2EnabledProtocols, "TLSv1");
assertTrue(clientSocket2.wasTlsFallbackScsvSet());
}