Domain=NSURLErrorDomain Code 1202

前端 未结 2 1533
情歌与酒
情歌与酒 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条回答
  •  萌比男神i
    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!

提交回复
热议问题