app-transport-security

Transport security has blocked a cleartext HTTP

倾然丶 夕夏残阳落幕 提交于 2019-11-25 22:13:48
问题 What setting do I need to put in my info.plist to enable HTTP mode as per the following error message? Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app\'s Info.plist file. Assume that my domain is example.com . 回答1: If you are using Xcode 8.0+ and Swift 2.2+ or even Objective C: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict>

How to use NSURLConnection to connect with SSL for an untrusted cert?

六眼飞鱼酱① 提交于 2019-11-25 21:58:24
问题 I have the following simple code to connect to a SSL webpage NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:url]; [ NSURLConnection sendSynchronousRequest: urlRequest returningResponse: nil error: &error ]; Except it gives an error if the cert is a self signed one Error Domain=NSURLErrorDomain Code=-1202 UserInfo=0xd29930 \"untrusted server certificate\". Is there a way to set it to accept connections anyway (just like in a browser you can press accept) or a way to bypass

How do I load an HTTP URL with App Transport Security enabled in iOS 9? [duplicate]

安稳与你 提交于 2019-11-25 21:43:53
问题 This question already has an answer here: Transport security has blocked a cleartext HTTP 25 answers So, the new beta SDK of iOS released last night has \"App Transport Security\" which encourages developers to use https instead of http. In principle, this is a great idea, and I already use https in our staging/production environments. However, I don\'t have https set up in my local development environment, when the iOS app is connecting to a web service I\'m running on my laptop. From a bit