Can't visit website on iOS Simulator—'This Connection Is Not Private'

你说的曾经没有我的故事 提交于 2019-12-03 11:42:37

问题


I'm currently building a watch app extension and want to use the simulator because it is much easier and quicker than building to my actual Apple Watch every time.

However, I've run into a problem with the simulator where I can't visit any websites due to the error 'This Connection Is Not Private'. This wouldn't normally be a problem except in my case I need to login into my iOS using Facebook and I face the same problem there. The message is slightly different when using SFSafariViewController:

  Safari cannot open the page because it could not establish a secure connection to the server

I have looked in the Safari settings on the simulator to see if there's any security that I can disable but have been unable to find anything. Is there any way I can get around this issue?

I'm currently using the Xcode 9.1 and macOS High Sierra 10.13.1


回答1:


It works for me after deleting all anti-virus programs from my Mac. Hope it would be helpful for you.




回答2:


Good morning,

I had the same problem with Avast in my Mac. You don't need to delete it, just go to the settings and disable the 'Web Shield' meanwhile you are using the simulator: See image for details

If you don't want to disable it for all the web sites, you could add the server to the excluded list: See image for details

Hope this helps! Regards.




回答3:


I've run into a problem with the simulator where I can't visit any websites due to the error 'This Connection Is Not Private'.

It sounds like you're probably running into App Transport Security, which requires apps to connect to servers securely. In most cases, all you need to do is change the method of the URL you're using from HTTP to HTTPS.



来源:https://stackoverflow.com/questions/46980164/cant-visit-website-on-ios-simulator-this-connection-is-not-private

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!