Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a self-signed certificate to iphone Simulator?

I have a self-signed certificate at the endpoint of my API. I'm trying to test some things using the simulator but am getting "untrusted server certificate".

I have tried to use safari on the simulator to download the .crt file, but that doesn't seem to work.

Where does iPhone Simulator get its keychain from? How can I add a trusted certificate so my application will work?

UPDATE

I got it to work by creating a CA and then adding a CA certificate using the iPhone provisioning tool. Then I was able to have a certificate signed by that CA certificate on the API server and the NSConnection just worked. I was not able to get it to work using a self-signed certificate for some reason. I need to re-attempt this using the provisioning software.

My real question is how do I get this to work on the simulator? I would think that the simulator uses the keychain of the actual computer.

like image 538
jr. Avatar asked Feb 08 '10 05:02

jr.


People also ask

How do I import a self-signed certificate to my iPhone?

For this, open again the iOS Settings app. Then navigate to “General” > “About” > “Certificate Trust Settings”. In the section “Enable Full Trust for Root Certificates”, enable your root certificate. With this, your app can connect now with the self-signed certificate to the backend.

How do I add a certificate to my iPhone?

If you want to turn on SSL/TLS trust for that certificate, go to Settings > General > About > Certificate Trust Settings. Under "Enable full trust for root certificates," turn on trust for the certificate. Apple recommends deploying certificates via Apple Configurator or Mobile Device Management (MDM).

How do I install Charles certificate on iPhone simulator?

iOS Simulators Quit your iOS Simulator. Launch Charles and go to the Help menu. Choose the "SSL Proxying > Install Charles Root Certificate in iOS Simulators" item. This will install your Charles Root Certificate into all of your iOS Simulators.


1 Answers

Just for Info, if someone still runs into that problem:

simply drag & drop your .cer Files into your running Simulator window. You'll see Safari flashing and then the import dialog for your Certificate (or Certificate Authority)...

Working for iOS 7 Simulator (and i Think did work for iOS 6 too).

like image 182
seafoxx Avatar answered Sep 18 '22 17:09

seafoxx