请查看:https://github.com/MugunthKumar/MKNetworkKit/issues/354
https://github.com/MugunthKumar/MKNetworkKit/commit/c28959805991bb8f0e99ede9c822e985b41f6fc9
) { |
|
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; |
- } |
- else if(result == kSecTrustResultConfirm) { |
- |
- if(self.shouldContinueWithInvalidCertificate) { |
- |
- // Cert not trusted, but user is OK with that |
- DLog(@"Certificate is not trusted, but self.shouldContinueWithInvalidCertificate is YES"); |
- [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; |
- } else { |
- |
- DLog(@"Certificate is not trusted, continuing without credentials. Might result in 401 Unauthorized"); |
- [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; |
- } |
- } |
- else { |
+ } else { |
|
// invalid or revoked certificate |
if(self.shouldContinueWithInvalidCertificate) { |
MK GitHub:https://github.com/MugunthKumar