簡體   English   中英

適用於iPhone的SSL證書 - >哪個CA?

[英]SSL certificate for iPhone -> which CA?

我發現NSUrlConnection的所有這些解決方法都使用封閉的API來訪問不受信任的SSL證書。 其他選項是首先使用Safari / Mail應用程序安裝證書。

我想知道安裝了哪些根證書,所以我可以從受信任的CA獲得一個,就像你應該這樣做的那樣。

任何人都知道我需要什么CA?

以下是iphone上安裝的可用CA預覽列表

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

您可以通過任何這些權限簽署您的證書,也可以使用OpenSSL簽署自己的證書並創建自己的CA.

實際上,您可以使用公共API接受自簽名SSL證書:

- (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];
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM