Я использую 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
}
)