Hi everyone, I'm very new to multiplatform but am trying to create a simple HTTP GET request on Linux
following this guide. I'm trying to use CIO as my engine on Linux but get the following error when trying to GET
https://ktor.io/.
Uncaught Kotlin exception: kotlin.IllegalStateException: TLS sessions are not supported on Native platform.
The code at this stage is fairly simple:
val client = HttpClient(CIO)
val httpResponse = client.get("<https://ktor.io/>")
val stringBody = httpResponse.body<String>()
println(stringBody)
Here's my `build.gradle.kts`:
sourceSets {
commonMain.dependencies {
implementation(libs.clikt)
implementation(libs.kotlinxCoroutines)
implementation(libs.kotlinxSerializationJson)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.cio)
implementation(libs.okio)
}
}
Am I doing something wrong or is making network requests on Linux not achievable with Kotlin Multiplatform? Thanks in advance.