Can somebody explain how to configure SSL with Dar...
# ktor
t
Can somebody explain how to configure SSL with Darwin HttpClient? I'm getting this exception when I try to connect to a web socket over SSL. io.ktor.client.engine.darwin.DarwinHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server."
The docs show all but Darwin. https://ktor.io/docs/client-ssl.html
l
Is the CIO engine a choice for you?
This ticket is from a few months ago, but it looks like SSL was JVM only at the time.
The ticket mentions a task to implement SSL in CIO, but I don’t know if that’s ready or not.
t
I get an error stating that TLS isn't supported on native, which was why I was trying Darwin.
a
The Darwin engine should work with SSL out-of-the-box. Are you able to connect to the server with another client?
t
My issue is when using a web socket. Other calls work fine. I can connect to the web socket fine when running the Android version of that app that uses the same shared code. The Android version is using OkHttp.
a
Could you please file an issue with an attached sample project that demonstrates this problem?
👍 1
t
I have a follow up question. I'm noticing that when I use the CIO engine with the Android build, the web socket works fine. I'm not adding any additional configuration to that engine other than logging. When I switch to OkHttp for the engine I get failures. Is there additional configuration required for OkHttp to connect to web sockets? I'm wondering if this is what I'm running into on iOS too.
a
Is there additional configuration required for OkHttp to connect to web sockets?
It isn’t required.
I’m wondering if this is what I’m running into on iOS too
The native Websockets support for the
Darwin
engine was introduced in Ktor 2.0.0 so most likely there is some other kind of problem.