Giorgi
12/27/2023, 8:34 PMprivate fun client(): HttpClient = HttpClient(CIO) {
install(Logging) {
level = LogLevel.ALL
logger = Logger.DEFAULT
}
engine {
proxy = ProxyBuilder.http("<http://0.0.0.0:8888/>")
}
}
Already tried setting trustManager
as described here https://ktor.io/docs/client-ssl.html#cio but trustManager
does not exists and can't import. Same is written here https://stackoverflow.com/a/69162766/4885394 but yeah, I got no trustManager
or sslContextBerkay Özkan
12/27/2023, 8:38 PMval trust = object : X509TrustManager {
override fun checkClientTrusted(p0: Array<out X509Certificate>?, p1: String?) {}
override fun checkServerTrusted(p0: Array<out X509Certificate>?, p1: String?) {}
override fun getAcceptedIssuers(): Array<X509Certificate>? = null
}
fun client() = HttpClient(CIO) {
engine {
https {
trustManager = trust
}
}
install(ContentNegotiation) {
json(
Json {
serializersModule = jsonSerializersModule
encodeDefaults = true
ignoreUnknownKeys = true
coerceInputValues = true
},
)
}
}
I use same way with stackoverflowephemient
12/27/2023, 8:48 PMephemient
12/27/2023, 8:50 PMGiorgi
12/29/2023, 7:34 PM