The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

前端 未结 21 1675
醉酒成梦
醉酒成梦 2020-11-22 11:37

I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error

\"The resource could not be load

21条回答
  •  既然无缘
    2020-11-22 12:22

    From Apple documentation

    If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn't follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app's Info.plist file.

    To Bypass App Transport Security:

    NSAppTransportSecurity
    
      NSExceptionDomains
      
        yourserver.com
        
          
          NSIncludesSubdomains
          
          
          NSTemporaryExceptionAllowsInsecureHTTPLoads
          
          
          NSTemporaryExceptionMinimumTLSVersion
          TLSv1.1
        
      
    
    

    To allow all insecure domains

    NSAppTransportSecurity
    
      
      NSAllowsArbitraryLoads
      
    
    

    Read More: Configuring App Transport Security Exceptions in iOS 9 and OSX 10.11

提交回复
热议问题