App Transport Security and IP addresses in iOS9

前端 未结 4 645
走了就别回头了
走了就别回头了 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:17

    As @PanxShaz said you can't put an hardcoded IP address but you can use an easy workaround:

    1. Open your /etc/hosts file using sudo and add a new local domain name for your ip address. Example:

      192.168.99.100 docker-host.localhost

    2. Then flush your DNS :

      dscacheutil -flushcache

    3. And finally use this new local domain in your app transport security exceptions.

提交回复
热议问题