https://kotlinlang.org logo
#ktor
Title
# ktor
s

Saood

02/27/2020, 4:21 PM
Did anyone tried configureSession() with ktor to set delegate for certificate validation? ktor version 1.3
Copy code
Ios.create {
    configureSession {
    }
}
Delegate method for certificate validation
Copy code
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.Void)
e

e5l

02/28/2020, 8:03 AM
Hi @Saood, we can make extension point for that in response handler.
s

Saood

02/28/2020, 10:09 AM
@e5l Can you please share sample code.
s

Saood

02/28/2020, 10:15 AM
great. so this will be included in new release 1.3.2 ?
e

e5l

02/28/2020, 10:15 AM
Yep, just merged in
master
s

Saood

02/28/2020, 10:15 AM
Great. Thanks
so there will be new block like configure session or configure request.
👍 1
i can see challengeHandler block
t

Thomas

02/28/2020, 11:54 AM
This great @e5l, thanks for adding it! Just wondering if it maybe is better to implement this method instead: https://developer.apple.com/documentation/foundation/nsurlsessiontaskdelegate/1411595-urlsession This one also has the task parameter. The method that you implemented in the commit without the task parameter is (as far as I know) not always called. (https://developer.apple.com/documentation/foundation/nsurlsessiondelegate/1409308-urlsession)
👀 1
See the “Discussion” under the second link
s

Saood

03/03/2020, 11:39 AM
@e5l When Ktor 1.3.2 will be release? with challenge handler.
e

e5l

03/03/2020, 11:46 AM
We don’t have an exact date for now, but we’re preparing for the end of this week.
s

Saood

03/03/2020, 11:47 AM
ok thanks @e5l
👍 1
a

Alistair Sykes

03/04/2020, 3:11 PM
Thanks for adding this. Super helpful.
e

e5l

03/04/2020, 6:48 PM
Thanks, I’ll take a look
btw PR’s are always welcome 🙂
32 Views