I support an SDK that connects to "api.sailthru.com". When I started testing with iOS9, it failed:
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x12e26d90 {NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9806, NSErrorFailingURLStringKey=https://api.sailthru.com/job, _kCFStreamErrorDomainKey=3, NSUnderlyingError=0xb01d990 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1200.)", NSErrorFailingURLKey=https://api.sailthru.com/job
I knew about the new entitlements, so I tried to construct one:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>api.sailthru.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
First, I tried with the full dictionary - where I set a minimum number for the TLS version, etc. Then deleted items and tried again. In the end, I could not find a way to get connections to my server working.
FInally, I used the big hammer:
<key>NSAppTransportSecurity</key>
<dict>
<!--Include to allow all connections (DANGER)-->
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Then, it worked. But this is no solution for the SDK users.
The OPS guys think it might be related to ciphers.
I'd love some options to play with - right now no one has any idea how to drill down on this. Oh, here is the CFNETWORKING log:
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:1] 11:43:00.035 {
LoaderWhatToDo
Request: <CFURL 0x7cea9150 [0x223ff70]>{string = https:/
CachePolicy: 1
WhatToDo: originload
CreateToNow: 0.00049s
} [1:1]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:2] 11:43:00.040 {
AddCookies Continue: request POST https:/
HTTPProtocol: Task: 7cee90f0
} [1:2]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:3] 11:43:00.041 {
Protocol Enqueue: request POST https:/
Request: <CFURLRequest 0x7ced6c20 [0x223ff70]> {url = https:/
Message: POST https:/
} [1:3]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:4] 11:43:00.123 {
Response Error
Request: <CFURLRequest 0x7ced6c20 [0x223ff70]> {url = https:/
Error: Error Domain=kCFErrorDomainCFNetwork Code=-1200 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1200.)" UserInfo=0x7bfae8c0 {_kCFNetworkCFStreamSSLErrorOriginalValue=-9806, _kCFStreamErrorCodeKey=-9806, _kCFStreamErrorDomainKey=3, _kCFStreamPropertySSLClientCertificateState=0}
} [1:4]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:5] 11:43:00.129 {
Did Fail
Loader: <CFMutableURLRequest 0x7ceefcb0 [0x223ff70]> {url = https:/
Error: Error Domain=kCFErrorDomainCFNetwork Code=-1200 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1200.)" UserInfo=0x7bfae8c0 {_kCFNetworkCFStreamSSLErrorOriginalValue=-9806, _kCFStreamErrorCodeKey=-9806, _kCFStreamErrorDomainKey=3, _kCFStreamPropertySSLClientCertificateState=0}
init to origin load: 0.00281298s
total time: 0.0941499s
total bytes: 0
} [1:5]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:6] 11:43:00.133 {
destroyReadStream: request POST https:/
Request: <CFURLRequest 0x7ced6c20 [0x223ff70]> {url = https:/
sent: <CFNumber 0x7c8657b0 [0x223ff70]>{value = +0, type = kCFNumberSInt32Type}
received: <CFNumber 0x7c8657b0 [0x223ff70]>{value = +0, type = kCFNumberSInt32Type}
cell sent: <CFNumber 0x7c8657b0 [0x223ff70]>{value = +0, type = kCFNumberSInt32Type}
cell received: <CFNumber 0x7c8657b0 [0x223ff70]>{value = +0, type = kCFNumberSInt32Type}
} [1:6]
Jun 22 11:43:00 Purser[49438] <Notice>: CFNetwork Diagnostics [1:7] 11:43:00.134 {
~HTTPProtocol: nullptr request
Request: null
sent: 0
received: 0
cell sent: 0
cell received: 0
} [1:7]
Please try again on b2 using the docs I referenced earlier to guide your Info.plist setup. If that doesn't work, post back and include your latest Info.plist settings.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1@apple.com"