How to import certificate via script

How to import certificate via script

When we try to access out internal site, we received this warning error  "There's a problem with this website security certificate. Proceed anyway"

We have a certificate that we can install to fix this error

If we access the link to the certificate manually, from the device, we could download the certificate and install it

My problem now is, I need to deploy this to multiple devices, so I need this done via a profile or a script

I did assigned a profile to keep the certificate in the SD card and tried to import it, but it did not installed properly

The script i use to run them is as below, but none of them seems to work

  • certimport -cert "/sdcard/xxxx" -ctype cert
  • certimport -cert "/sdcard/xxx" -ctype certificate_type -itype "install_type"
  • certimport -cert "/sdcard/xxx" -ctype certificate_type -itype "install_type" -storage "storage_type"

 

Certificate is a chain, private root CA and private TLS CA certificate

The manual installation will put the certificate here in this location

Settings > Security > Trusted Credentials > User

 

When I used the certimport script, it will move my cert from the SD card, but I dont know where it went

And the warning will still be there, and the certificate are not in the desired place.

 

Any advise on how I can have these certificate install automatically?

Thank you

  • 07 May 2021
  • SOTI MobiControl
  • 2 Answers
  • 0 Upvote
  • 2 Followers
  • 1.1K Views
    • 2 Answers
    • 0 Upvote
    • 2 Followers

2 Answers

Order By:   Standard | Newest | Votes
JCMOD@SOTI | posted this 10 May 2021

Hi Aya,

 

Thank you for posting in SOTI Central.

 

Instead of using the /sdcard/ try using %sdcard%xxx for example. Rather than /sdcard/xxx. Also alternatively, you may be able to deploy the Certificate through a Certificate Profile instead.

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
Matt Dermody | posted this 10 May 2021

I would definitely recommend trying to leverage the Certificate Profile first and then only resort to the script based installation if that doesn't work for your situation. It will be a lot cleaner to manage within the Profile option. 

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback