Alamofire在swift5下无条件信任证书
作者:
CicadaJZ | 来源:发表于
2020-05-21 14:00 被阅读0次extension ViewController : URLSessionDelegate {
public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!)
completionHandler(.useCredential, urlCredential)
}
}
本文标题:Alamofire在swift5下无条件信任证书
本文链接:https://www.haomeiwen.com/subject/ecmzohtx.html
网友评论