“发生了ssl错误,无法与服务器建立安全连接”仅在手机上连接到Internal Development Server
我开发了一个连接到内部Web服务器的iOS应用程序。当我使用模拟器时,它工作正常,但是当我在iPhone上构建相同的应用程序时,它给出了一条错误消息发生了ssl错误,无法建立与服务器的安全连接。 为什么错误只发生在iPhone而不是模拟器中?
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?
这是我的环境
Xcode 8.2
iOS 10.3
目标C - - 我的客户端代码默认使用ATS
AFNetworking Framework 3.1
Web服务器 - 支持TLS 1.2仅
Web服务器证书尚不支持前向保密。
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.
可能是因为我的证书不符合ATS吗?
Could it be because that my Cert is not ATS compliant?
我读完这篇文档
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>Your Domain</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
我的应用程序正在使用设备。我在服务器上的证书尚未准备好Forward Secrecy。
My app is now working on devices. My cert on the server is not Forward Secrecy ready yet.