我正在使用以下代码在iOS 9中向https服务器发送POST请求:
[NSURLConnection sendSynchronousRequest:request returningResponse:&requestResponse error:&err];
但是我遇到了以下错误
CFNetwork SSLHandshake failed (-9824)
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
我尝试将以下异常添加到info.plist中:
我尝试将以下异常添加到info.plist中:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.myserver.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
我也尝试过
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
在真实设备上可以运行,但模拟器上无法运行