import io.ktor.client.HttpClient
import io.ktor.client.engine.android.Android
import nl.altindag.ssl.SSLFactory
class App {
fun main(args: Array<String>) {
val sslFactory = SSLFactory.builder()
.withIdentityMaterial("identity.jks", "password".toCharArray())
.withTrustMaterial("truststore.jks", "password".toCharArray())
.build()
val httpClient = HttpClient(Android) {
engine {
sslManager = { httpsURLConnection ->
httpsURLConnection.hostnameVerifier = sslFactory.hostnameVerifier
httpsURLConnection.sslSocketFactory = sslFactory.sslSocketFactory
}
}
}
}
}