Domain=NSURLErrorDomain Code 1202

前端 未结 2 1529
情歌与酒
情歌与酒 2020-12-14 19:00

Hi I receive the following error:

Error Domain=NSURLErrorDomain Code=-1202 \\\"The certificate for this server is invalid. You might be connecting to

相关标签:
2条回答
  • 2020-12-14 19:21

    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.
    0 讨论(0)
  • 2020-12-14 19:32

    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 by exporting 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!

    0 讨论(0)
提交回复
热议问题