2

I have Xcode and an iOS Simulator (iPhone 11 - 13.3) installed on my Mac. The Mac itself is going through my company's proxy server. It is connecting properly to the Internet - I can bring up desktop Safari and browse to any external site.

However I can't do the same through the iOS Simulator. When I open Safari on the simulator and try to visit an external site, I get this error message:

enter image description here

How do I get this to work?

Naresh
  • 23,937
  • 33
  • 132
  • 204
  • It looks like your company has installed their own root certificate on your Mac so that they can man-in-the-middle decrypt your encrypted traffic as it traverses the proxy; I wouldn't like this, but it is their network. Your simplest approach is just to tap the "visit this website" link. If you can get your IT people to supply the relevant root certificate file then you can use [this answer](https://stackoverflow.com/questions/2219707/adding-a-self-signed-certificate-to-iphone-simulator) to install it on your simulator – Paulw11 Jan 30 '20 at 02:48
  • Thanks, Paul. Yes, they do provide a root certificates file, which I installed on the simulator using the answer link you provided. Also did the extra step to install/trust the certs. However that does not help. For some sites (like google.com), I just clicked the "visit this website" link and was able to go to it. However, for many sites (like https://github.com), I get a different error: "Safari cannot open this page because it could not establish a secure connection to the server." There is no escape hatch in this case! – Naresh Jan 30 '20 at 17:39
  • The only deviation I see from the answer you pointed to is this: when I drag the cert to the simulator window, it first directs me to install the cert from Settings > General > Profile. It seems that it is treating it as a profile. After I install it, I go to Settings > General > About > Certificate Trust Settings, but I don't see the cert there to enable it for SSL (as the answer describes). – Naresh Jan 30 '20 at 20:44

1 Answers1

2

Solved. The answer was a combination of the SO answer referred by @Paulw11 + a thread on Apple Developer Forums.

You must drag the cert and drop it on the simulator + you must make sure that you are not dragging from any of the 3 D folders (Desktop, Documents, Downloads). The second requirement tripped me up for hours on MacOS Catalina.

Naresh
  • 23,937
  • 33
  • 132
  • 204