How can I add NSAppTransportSecurity to my info.plist file?

前端 未结 14 1297
野趣味
野趣味 2020-11-22 12:48

https://developer.apple.com/videos/wwdc/2015/?id=711 @5:55

I can\'t seem to be able to add this to my info.plist. There is no value it. I\'m running XCode Version 7.

14条回答
  •  囚心锁ツ
    2020-11-22 13:22

    try With this --- worked for me in Xcode-beta 4 7.0

    NSAppTransportSecurity
    
        NSExceptionDomains
        
            yourdomain.com
            
                
                NSIncludesSubdomains
                
                
                NSTemporaryExceptionAllowsInsecureHTTPLoads
                
                
                NSTemporaryExceptionMinimumTLSVersion
                TLSv1.1
            
        
    
    

    Also one more option, if you want to disable ATS you can use this :

    NSAppTransportSecurity  
       
          NSAllowsArbitraryLoads  
     
    

    But this is not recommended at all. The server should have the SSL certificates and so that there is no privacy leaks.

提交回复
热议问题