in Sources/OSS/Internal/OSSURLSessionDelegate.swift [17:39]
func urlSession(_: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
var disposition = URLSession.AuthChallengeDisposition.performDefaultHandling
var credential: URLCredential?
let host = challenge.protectionSpace.host
switch challenge.protectionSpace.authenticationMethod {
#if canImport(Security)
case NSURLAuthenticationMethodServerTrust:
if let serverTrust = challenge.protectionSpace.serverTrust {
if !enableTLSVerify ||
evaluate(serverTrust: serverTrust, domain: host)
{
disposition = URLSession.AuthChallengeDisposition.useCredential
credential = URLCredential(trust: serverTrust)
}
}
#endif
default:
disposition = URLSession.AuthChallengeDisposition.performDefaultHandling
}
completionHandler(disposition, credential)
}