“an ssl error has occurred and a secure connection to the server cannot be made” connecting to Internal Development Server on phone only

梦想与她 提交于 2019-12-01 02:24:28

问题


I developed a iOS app that connects to a internal web server. When I used the simulator, it works fine, but when I build the same app on a iPhone, it gives me a error message “an ssl error has occurred and a secure connection to the server cannot be made. " Why the error only occurs on iPhone not in simulator?

Here is my environment Xcode 8.2 iOS 10.3 Objective C -- My client code is using ATS by default AFNetworking Framework 3.1 Web Server -- Support TLS 1.2 only Web Server Cert is not supporting forward secrecy yet.

Could it be because that my Cert is not ATS compliant?


回答1:


After I read this document from Apple

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>Your Domain</key>   
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>                
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

My app is now working on devices. My cert on the server is not Forward Secrecy ready yet.



来源:https://stackoverflow.com/questions/43286204/an-ssl-error-has-occurred-and-a-secure-connection-to-the-server-cannot-be-made

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!