NSExceptionAllowsInsecureHTTPLoads not working for IP addresses

后端 未结 3 1316
暖寄归人
暖寄归人 2020-12-10 22:32

excluding ATS on iOS 9 doesn\'t work for me.

I have a test server which has no domain name (IP address only) and no SSL certificate (so it is HTTP and not HTTPS)

3条回答
  •  情深已故
    2020-12-10 22:53

    Actually, the real problem is that in iOS 9, ATS exceptions do not work with IP addresses. It only works with domain names. Turning off ATS altogether is a bad idea, and will cause you to justify that decision if you wish to submit to the app store after 12/31/2016.

    Unfortunately, there is not a great solution to this short of trying to get a domain name for the server you are trying to connect to.

    Others have had success using xip.io service to "convert" the local IP address to a domain name. So you would add xip.io to the Exception domains, set the subvalue for NSIncludesSubdomains to true. Then when you connect to your domain, instead of connecting to 52.24.145.252 you would connect to 52.24.145.252.xip.io

提交回复
热议问题