Domain=NSURLErrorDomain Code 1202 Domain=NSURLErrorDomain Code 1202 ios ios

Domain=NSURLErrorDomain Code 1202


For the devs who are working with a server locally and need to get the iOS Simulator to trust the certificate. Follow the steps below:

  1. Get the .cer file by exporting the certificate from the Keychain. You need the certificate file in a valid format and its easiest to get this byexporting it from the Keychain.

  2. Drag and drop the aforementioned .cer file onto the simulator. It should give you a prompt on installing a "Profile". Go ahead and follow the instructions to install it.

  3. For those who are working with the latest versions of XCode and iOS Simulator. You need to do 1 last step. The Simulator must be explicitly told to trust the root CA. Do this by going to General -> About -> Certificate Trust Settings -> "Enable Full Trust for Root Certificate" for your particular certificate

Hopefully, this saves headaches for some people!


It took a lot of time for me to find a fix for this:

If any of us ran across the certificate issue,.It is because of antivirus preventing iPhone simulator to browse any websites.I was able to fix this issue by the following steps:

  1. uninstall or turn off Antivirus in Mac.
  2. erase all content and settings of simulator.
  3. restart mac.