How to create and import Self Signed Certificate to Android Device

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

Steps to Install SSL Certificate in Android Device

Due to a bug in android internal code you need some extra steps while generating your certificate. Otherwise your self-signed certificate will not show up under “trusted credentials” in android menu.

Create an auxiliary file “android_options.txt” with this line inside:

  • basicConstraints=CA:true

Create self-signed certificate using these commands:

  • openssl genrsa -out priv_and_pub.key 2048
  • openssl req -new -days 3650 -key priv_and_pub.key -out CA.pem
  • openssl x509 -req -days 3650 -in CA.pem -signkey priv_and_pub.key -extfile ./android_options.txt -out CA.crt

Now our CA.crt certificate is almost ready.

⏬ ⏬  Get rid of “⚠️ Not Secure” warning with these trusted SSL Certificates  ⏬ ⏬ 

95%
OFF

comodo-square-logo

Comodo Positive SSL

$6.55

Vendor Price: $41.73

Coupon Code: ASCSCPSSL4

Get It Now

78%
OFF

rapidssl-coupon-square-logo

RapidSSL Certificate

$13.45

Vendor Price: $69

Coupon Code: ASRSRSSL2

Get It Now

95%
OFF

comodo-square-logo

Comodo PositiveSSL Multi-Domain

$17.54 – 2 SAN Included

Vendor Price: $41.73

Coupon Code: ASCSCPMD4

Get It Now

Convert certificate to DER format:

  • openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt

Import CA.der.crt:

  • Put the CA.der.crt onto the sdcard of your Android device (usually to internal one). It should be in root directory.
  • Go to Settings / Security / Credential storage and select “Install from device storage”.
  • The .crt file will be detected and you will be prompted to enter a certificate name.
  • After importing the certificate, you will find it in Settings / Security / Credential storage / Trusted credentials / User.
Download Site Seal
comodo-trust-seal
SSL Checker