iOS 9.1 で自己署名 HTTPS サーバーに接続しようとしています。
私は使用しています:
[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&error];
そして、証明書が無効であるというエラーが表示されます。
Error Domain=NSURLErrorDomain Code=-1202 "<French error saying the certificate is invalid"
UserInfo=
{NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x13c768140>,
NSLocalizedRecoverySuggestion=<French recovery suggestion asking if the user wants to connect anyway>, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9813, NSErrorPeerCertificateChainKey=<CFArray 0x13d82ffe0 [0x1a1242b68]>
考えられるすべてのトランスポート セキュリティ例外を追加しようとしましたが、現在の試みは次のとおりです。
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mydomain.org</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
私も試しましNSAllowsArbitraryLoads
たが、それでもうまくいきません。いくつかの .plist ファイル (ココアポッドとテスト) がありますが、正しいファイル (App/Supporting Files/Info.plist) にあると思います。
何が間違っている可能性がありますか?