Search code examples
iosobjective-capp-transport-security

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)


I've been working on this project for a month and all internet requests were working fine until today, I am seeing this error whenever I execute a request :

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)

Although, in my info.plist, I added the APT configuration from the start:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Keep in mind, that everything was working fine, I didn't change anything. I tried this, on iOS 9 and iOS 7, and I am getting the same error.


Solution

  • try this in info.plist,

    <key>NSAppTransportSecurity</key>
    <dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>YOURHOST.COM</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>1.0</string>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
    

    and refer this link for more detail. hope this will help :)