hi guys, i want to set SSL for my darwin engine cl...
# ktor
z
hi guys, i want to set SSL for my darwin engine client,but it not wroks,do i miss something? this is what i followed page i init ktor client like this:
Copy code
actual val httpClient= HttpClient(Darwin) {
    engine {
        val builder = CertificatePinner.Builder()
            .add(Constant.URL.HOST, "sha256/nlbd3VArZQ+Smfw+442a+xc5iig/8cmP9F0YVl6Q5+Q=")
        handleChallenge(builder.build())
    }
}
here is all log i get:
CertificatePinner: Server trust is invalid
HttpClient: REQUEST https://www.buxiang.wang/user/fastLogin failed with exception: io.ktor.client.engine.darwin.DarwinHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://www.buxiang.wang/user/fastLogin, NSErrorFailingURLKey=https://www.buxiang.wang/user/fastLogin, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <08C704F3-8119-46DB-925A-AE027A6FED51>.<1>" ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <08C704F3-8119-46DB-925A-AE027A6FED51>.<1>, NSLocalizedDescription=cancelled} by the way , android ktor client and ktor server works fine.
or is there any way else to set SSL on iOS platform?
and i generated a self-signed certificate by keystore explorer
a
So do you want to make the client trust the self-signed certificate?
z
yes