Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 478
JIANG Avatar asked Apr 07 '17 19:04

JIANG


Video Answer


1 Answers

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.

like image 114
JIANG Avatar answered Oct 10 '22 04:10

JIANG