App Transport Security and IP addresses in iOS9

前端 未结 4 664
走了就别回头了
走了就别回头了 2020-11-30 00:02

I develop my iOS app using a local server running on my dev box. When testing on devices, I connect directly via an IP address, which is over HTTP and not HTTPS (so I don\'t

4条回答
  •  醉话见心
    2020-11-30 00:26

    is there anything else I can do without also enabling NSAllowsArbitraryLoads?

    One workaround is to use xip.io, as explained by QJeffR in this Apple Developer Forums thread (which was shared by David L in his comment):

    A DNS call to (for example) 10.0.1.8.xip.io will resolve to 10.0.1.8, allowing use of the domain instead of the IP address for the NSExceptionDomains key.

提交回复
热议问题