suspend fun main() {
val client = HttpClient(Java)
val response1 = client.get("<https://sha256.badssl.com/>")
println(response1.status)
val response2 = client.get("<https://untrusted-root.badssl.com/>")
println(response2.status)
}
prints
Copy code
200 OK
200 OK
😬
Even though the second URL doesn’t have a valid certificate.
Sam
01/27/2023, 2:19 PM
It works as expected (i.e. first request succeeds; second request fails) with the Apache engine. It also works as expected when using a freshly-created HttpClient for each request (as mentioned in the StackOverflow post)
e
e5l
01/27/2023, 2:23 PM
Hey @Sam, could you log an issue? I will take a look