NSURLSession/NSURLConnection HTTP load failed on iOS 9

前端 未结 13 1418
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 05:20

Tried to run my existing app on iOS9 but getting failure while using AFURLSessionManager.

__block NSURLSessionDataTask *task = [self.sessionMana         


        
13条回答
  •  温柔的废话
    2020-11-22 06:12

    How to deal with the SSL in iOS9,One solution is to do like:

    As the Apple say : enter image description here enter image description here

    enter image description here

    iOS 9 and OSX 10.11 require TLSv1.2 SSL for all hosts you plan to request data from unless you specify exception domains in your app's Info.plist file.

    The syntax for the Info.plist configuration looks like this:

    NSAppTransportSecurity
    
      NSExceptionDomains
      
        yourserver.com
        
          
          NSIncludesSubdomains
          
          
          NSTemporaryExceptionAllowsInsecureHTTPLoads
          
          
          NSTemporaryExceptionMinimumTLSVersion
          TLSv1.1
        
      
    
    

    If your application (a third-party web browser, for instance) needs to connect to arbitrary hosts, you can configure it like this:

    NSAppTransportSecurity
    
        
        NSAllowsArbitraryLoads
        
    
    

    If you're having to do this, it's probably best to update your servers to use TLSv1.2 and SSL, if they're not already doing so. This should be considered a temporary workaround.

    As of today, the prerelease documentation makes no mention of any of these configuration options in any specific way. Once it does, I'll update the answer to link to the relevant documentation.

    For more info ,go to iOS9AdaptationTips

提交回复
热议问题