How to install self signed certificate to iPhone simulator running iOS 18.5?

I am trying to communicate with the backend of my project. So I need to install the certificate into the simulator. I have the .pem file but when I drag-dropped it into the simulator, I got the error "Simulator device failed to complete the requested operation.". The simulator is an iPhone 16 Pro running iOS 18.5. Is there any way to install the cert to my simulator?

PS: I can't use Apple Configurator or MDM because I am using the office's Mac. And I can't install anything there. So I can only do it manually.

Answered by DTS Engineer in 864053022

Self-signed server certificates are tricky, and I recommend that you avoid them. Rather, my advice is that you set up a test certificate authority (CA) and then have it issue a certificate to your server. That’s a path that works reliably.

I use Certificate Assistant for this, as explained in TN2326 Creating Certificates for TLS Testing.

Once you have this set up, you can install your CA’s root certificate as explained in QA1948 HTTPS and Test Servers.

This process might actually work for your existing server certificate, but my experience is that it’s quite brittle. Still, you’re falling at the first hurdle right now:

I have the .pem file

You need to convert this to DER. The ‘dragging to the simulator’ technique doesn’t work for PEMs.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Update: I've tried downloading the PEM cert from Safari inside the simulator and installed the profile. But it didn't show in the Settings/General/About/Certificate Trust Settings.

Self-signed server certificates are tricky, and I recommend that you avoid them. Rather, my advice is that you set up a test certificate authority (CA) and then have it issue a certificate to your server. That’s a path that works reliably.

I use Certificate Assistant for this, as explained in TN2326 Creating Certificates for TLS Testing.

Once you have this set up, you can install your CA’s root certificate as explained in QA1948 HTTPS and Test Servers.

This process might actually work for your existing server certificate, but my experience is that it’s quite brittle. Still, you’re falling at the first hurdle right now:

I have the .pem file

You need to convert this to DER. The ‘dragging to the simulator’ technique doesn’t work for PEMs.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I see. Thank you for the answer. I will consult with the BE guys for this.

How to install self signed certificate to iPhone simulator running iOS 18.5?
 
 
Q