kCFStreamErrorDomainSSL, -9802 when connecting to a server by IP address through HTTPS in iOS 9

后端 未结 5 1897
暗喜
暗喜 2020-11-28 16:03

We have an iOS app that connects to our server through HTTPS. When the app is built with the new iOS 9 SDK and ran under iOS 9, the following error occurs:

N         


        
5条回答
  •  日久生厌
    2020-11-28 16:19

    Solution 1 :

    If you’re looking for work around then use below approach :

    1. Add NSAllowsArbitraryLoads key of type boolean with value true.

    Your Info.plist file should look like this :

    However, this approach is not recommended since it allows all unsecure connection.

    Solution 2 :

    The SSL certificate that you apply on Server should be of type TLSv2.0 minimum since iOS 10 requires this. Check this link for detail.

    1. Add NSIncludesSubdomains key of type boolean with value true
    2. Add NSTemporaryExceptionAllowsInsecureHTTPLoads key of type boolean with value true
    3. Add NSTemporaryExceptionMinimumTLSVersion key of type String with value TLSv1.2

    Your Info.plist file should look like this :

提交回复
热议问题