您的位置:首页 > 理论基础 > 计算机网络

xcode7以后,访问https服务器

2016-06-03 22:27 477 查看
在plist中

增加NSAppTransportSecurity  nsdictionary

子属性  NSAllowsArbitraryLoads  boolean  YES

就能正常访问

如果不加,报如下错误:

UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7fec41ee5df0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x7fec41ee8800 {Error Domain=kCFErrorDomainCFNetwork
Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: