Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install certificate to iOS device via OSX

I'm doing some automated certificate testing for an iOS app and want to know of a way to install a root certificate onto the device by way of the terminal.

The goal is to have this whole certificate install process be automated with no user interaction. It would be totally acceptable to have this done via the Automator if installing the certificate can be done through a GUI on the Mac.

I've looked at: iOS: Pre install SSL certificate in keychain - programmatically but it's not applicable because this is being done through Objective-C in the app itself. I want to do completely separately from the app.

And I don't believe How to install developer certificate/private key and provisioning profile for iOS development via command line? is applicable because it's installing the development cert to the Mac's keychain not a generic cert to the iOS device.

An answer of "this is impossible" with proof would be totally acceptable as well.

EDIT 1

Per the suggestion of @Rivera I attempted to use the Prepare feature of Configurator but it is too intrusive: a new version of iOS is installed, the device is unusable for ~10 minutes, user interaction was required etc. I just want to do one action: install the certificate.

Further research showed no CLI or scripting capabilities with the Configurator aside from some hacks that may or may not work found here.

I've put out a ticket with Apple to see if they've got any more information.

EDIT 2

Added this line: "It would be totally acceptable to have this done via the Automator if installing the certificate can be done through a GUI on the Mac." to the main question body.

like image 307
Reuben Tanner Avatar asked Aug 08 '14 15:08

Reuben Tanner


People also ask

How do I manually install a certificate on 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 a self-signed certificate on my Iphone?

Open settings and use the search at the top to look for profiles. Open profiles and "install" the profile for your self-signed cert. Then go to settings->general->about->certificate trust settings (all the way at the bottom) and flip the toggle to trust all roots for that profile.


1 Answers

I would take a look at Apple Configurator to see if it has some CLI/scripting support.

like image 98
Rivera Avatar answered Oct 15 '22 01:10

Rivera