Hi,
How do I perform SSL authentication with p12 certificate for a webview request as we do for NSUrlSession. I am able to handle the authentication with the certificate using the delegate "didReceiveChallenge". Please look at the below code snippet which i used for NSUrlSession:
NSString *strAuthenticationMethod = challenge.protectionSpace.authenticationMethod;
NSLog(@"authentication method: %@", strAuthenticationMethod);
NSURLCredential *credential = nil;
if([strAuthenticationMethod isEqualToString:NSURLAuthenticationMethodClientCertificate])
{
credential = [self getCredentialsForClientTrust]; // This function will give me a NSURLCredential object for my p12 certificate
if(credential)
{
NSLog(@"credentials obtained%@",credential);
completionHandler(NSURLSessionAuthChallengeUseCredential,credential);
}
else{
NSLog(@"failed to get credentials %@",credential);
completionHandler(NSURLSessionAuthChallengeUseCredential,nil);
}
}
else
{
completionHandler(NSURLSessionAuthChallengeUseCredential,nil);
}
This works perfectly, but how do I perform this operation for a webview request?
Thanks!!