Hey all, so I am attempting to make a POST request...
# ktor
b
Hey all, so I am attempting to make a POST request in a unit test using ktor on iOS (native) and I get this certificate error.
io.ktor.client.engine.ios.IosHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid..."
Any ideas on how to solve this? (this request works on every other device I've tried.)
e
Hi @bsimmons, could you tell me if you're using a device or a simulator?
b
I am using a simulator.
e
Could you check that you have all root certs on the simulator? You also can set custom
handleChallenge
in the
iOS
engine config to bypass this check.
b
I'm not entirely sure how checking the root certs works on the simulator.
r
Possibly related: https://youtrack.jetbrains.com/issue/KT-38317 (the error is the same but the setup sounds different)
b
@russhwolf Pure gold. That answer got things working. Thanks for the help!
👍 1