From 2edba8aa2bf84e4fe895aa1d35082ef18db4566b Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sun, 26 Jul 2026 12:00:01 +0100 Subject: [PATCH 1/2] Handle conscrypt changes --- .../internal/connection/RetryConnectionTest.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt index 711d77f3364f..e94813dc23e5 100644 --- a/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt +++ b/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt @@ -29,6 +29,7 @@ import okhttp3.ConnectionSpec import okhttp3.OkHttpClientTestRule import okhttp3.TestValueFactory import okhttp3.TlsVersion +import okhttp3.testing.PlatformRule import okhttp3.tls.internal.TlsUtil.localhost import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test @@ -41,6 +42,9 @@ class RetryConnectionTest { @RegisterExtension val clientTestRule = OkHttpClientTestRule() + + @RegisterExtension + val platform = PlatformRule() private var client = clientTestRule.newClient() @@ -98,7 +102,14 @@ class RetryConnectionTest { // COMPATIBLE_TLS is used here. socket = createSocketWithEnabledProtocols(*enabledSocketTlsVersions) connectionSpecs[attempt1.connectionSpecIndex].apply(socket, attempt1.isTlsFallback) - assertEnabledProtocols(socket, TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0) + + if (platform.isConscrypt()) { + // Conscrypt 2.5.2 deprecated TLS 1.0 and 1.1, and 2.6 dropped them + assertEnabledProtocols(socket, TlsVersion.TLS_1_2) + } else { + assertEnabledProtocols(socket, TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0) + } + val attempt2 = attempt1.nextConnectionSpec(connectionSpecs, socket) assertThat(attempt2).isNull() socket.close() From 0a862946dac3f46a1bcfc51f7be25524dec3cd14 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sun, 26 Jul 2026 12:18:27 +0100 Subject: [PATCH 2/2] reformat --- .../kotlin/okhttp3/internal/connection/RetryConnectionTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt index e94813dc23e5..8d75d19e9d6d 100644 --- a/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt +++ b/okhttp/src/jvmTest/kotlin/okhttp3/internal/connection/RetryConnectionTest.kt @@ -42,7 +42,7 @@ class RetryConnectionTest { @RegisterExtension val clientTestRule = OkHttpClientTestRule() - + @RegisterExtension val platform = PlatformRule() @@ -102,7 +102,7 @@ class RetryConnectionTest { // COMPATIBLE_TLS is used here. socket = createSocketWithEnabledProtocols(*enabledSocketTlsVersions) connectionSpecs[attempt1.connectionSpecIndex].apply(socket, attempt1.isTlsFallback) - + if (platform.isConscrypt()) { // Conscrypt 2.5.2 deprecated TLS 1.0 and 1.1, and 2.6 dropped them assertEnabledProtocols(socket, TlsVersion.TLS_1_2)