NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) on a subdomain?

前端 未结 1 2030
花落未央
花落未央 2021-01-03 10:32

Our app is working fine on both our production and development environments but on our staging environment we get the common error:

NSURLSession/NSURLConnect         


        
1条回答
  •  时光说笑
    2021-01-03 10:50

    App Transport Security is not just HTTP vs HTTPS. You need to be using properly configured servers+certificates to avoid an ATS issue. From the Apple docs [1]:

    The server must support at least Transport Layer Security (TLS) protocol version 1.2. Connection ciphers are limited to those that provide forward secrecy. Certificates must be signed using a SHA256 or greater signature hash algorithm, with either a 2048 bit or greater RSA key or a 256 bit or greater Elliptic-Curve (ECC) key. Invalid certificates result in a hard failure and no connection.

    If you're on OS X 10.11 (or later), you can use nscurl to troubleshoot. Pop open a terminal and run this:

    /usr/bin/nscurl --ats-diagnostics https://staging.ourdomain.com
    

    [1] https://developer.apple.com/library/ios/technotes/App-Transport-Security-Technote/index.html

    0 讨论(0)
提交回复
热议问题