SSL Certificate for iPhone & # 8594; which CA?

I find all of these workarounds for NSUrlConnection that use a private API to access an SSL certificate that is not trusted. Other options are to install the certificate first using the Safari / Mail application.

I would like to know which root certificates are installed, so I can get one from a trusted CA, how you should do this.

Does anyone have an idea of ​​which CA I need?

+4
source share
2 answers

Here is a list of available CAs installed on iphone

http://support.apple.com/kb/HT2185

You can get your certificates signed by any of these authorities, or you can sign your own certificates and create your own CA using OpenSSL

+3
source

In fact, you can accept a self-signed SSL certificate using the public APIs:

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; } - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; } [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; } 
0
source

Source: https://habr.com/ru/post/1308773/


All Articles