Connect to a Server with Invalid Certificate using NSURLSession (swift2,xcode7,ios9)

前端 未结 5 715
栀梦
栀梦 2021-01-13 05:55

I\'m using Xcode 7, Swift 2, and iOS9. I want to connect to a web service using NSURLSession but I get the following error when I try to connect:

2015-10-13          


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 06:32

    open your info.plist as a source code Add following:

        NSAppTransportSecurity
        
               NSAllowsArbitraryLoads
              
       
    

    This should help.

提交回复
热议问题