I’m currently working on a Kotlin project using coil3 for image loading. I’m encountering an SSL handshake aborted error with the following details:
javax.net.ssl.SSLHandshakeException: Handshake failed
...
SSL handshake aborted: ssl=0x7b0998168998: Failure in SSL library, usually a protocol error
error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION (third_party/openssl/boringssl/src/ssl/tls_record.cc:592 0x7b09881aecf0:0x00000003)
I’ve tried adjusting the TLS versions and cipher suites that my client supports, and I’ve confirmed that the server is working as expected and supports the TLS versions I’m trying to use. I’ve also tried using a custom SSLSocketFactory
that enables the necessary TLS versions on older devices. However, the issue persists.
Here’s a snippet of my code:
val client = OkHttpClient().newBuilder()
.connectionSpecs(listOf(ConnectionSpec.MODERN_TLS, ConnectionSpec.RESTRICTED_TLS))
.build()
val imageLoader = ImageLoader.Builder(LocalContext.current)
.components {
add(
OkHttpNetworkFetcherFactory {
client
}
)
}
.build()
val request = ImageRequest.Builder(LocalContext.current)
.data("https://info.defcon.org/blobs/v_aerospace.png")
.build()
AsyncImage(
model = request,
contentDescription = "logo",
modifier = Modifier
.background(Color.White)
.fillMaxSize(),
imageLoader = imageLoader,
)
I’m using Android Studio Koala | 2023.3.2 Canary 2 as my IDE. The issue occurs on both older and newer Android versions.
Any help or suggestions would be greatly appreciated.