diff options
Diffstat (limited to 'luni/src/test/java/libcore/java/net/URLConnectionTest.java')
-rw-r--r-- | luni/src/test/java/libcore/java/net/URLConnectionTest.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java index 7a2d74ad90d..7b00d1d5488 100644 --- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java +++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java @@ -3142,7 +3142,7 @@ public final class URLConnectionTest { // Leave out one protocol. First in the array will be the oldest protocol with // Conscrypt, but it shouldn't matter which we omit. String[] expectedProtocols = - Arrays.copyOfRange(platformProtocols, 1, platformProtocols.length - 1); + Arrays.copyOfRange(platformProtocols, 1, platformProtocols.length); TestSSLContext testSSLContext = createDefaultTestSSLContext(); SSLSocketFactory serverSocketFactory = @@ -3166,7 +3166,10 @@ public final class URLConnectionTest { } private String[] platformDefaultTlsProtocols() throws Exception { - return SSLContext.getDefault().getSupportedSSLParameters().getProtocols(); + try (SSLSocket socket = (SSLSocket) SSLContext.getDefault().getSocketFactory() + .createSocket()) { + return socket.getEnabledProtocols(); + } } private static void assertSslSocket(TlsFallbackDisabledScsvSSLSocket socket, |