Hi all. Im trying to disable ssl for my ktor clien...
# ktor
x
Hi all. Im trying to disable ssl for my ktor client. I've been following this stackoverflow post. However, my project is an multiplatform project, and i'm making use of the default engine to create my client in
commonMain
. Given that this ssl-disabling is slightly different for each engine, is there a way to do this neatly for each engine without having to `expect`/`actual` the whole engines for each platforms?
m
Since the disabling logic is very different for each platform there’s no way to do it in common for every platform, at least that ive found. Another catch w that I’ve run into that would prevent a common method is that you cant actually disable it for JS running on browser afaik, just for Node
😥 1
x
yeah ended up giving up having to `expect`/`actual` the whole engines for each platforms
Copy code
@HttpClientDsl
expect fun HttpClient(
  block: HttpClientConfig<*>.() -> Unit = {}
): HttpClient

//androidMain
@HttpClientDsl
actual fun HttpClient(
  block: HttpClientConfig<*>.() -> Unit,
): HttpClient = HttpClient(CIO) {
  engine {
    https {
      trustManager = TrustAllManager
    }
  }

  block()
}