我使用Alamofire(4.7.3),Xcode 10(Swift4.2)。我使用这些代码进行相互认证
manager.delegate.sessionDidReceiveChallenge = { (session,challenge) in
if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
// it's ok
}
else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodClientCertificate {
// can't receive NSURLAuthenticationMethodClientCertificate
}
)