Installing Certificates on Android 4.0 and Later Physical Devices
Android 4.0 (Ice Cream Sandwich) and later supports DER-encoded X.509 certificates saved in files with a .crt or .cer file extension.
Note: | If you do not have a valid certificate installed, you will see the error javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. |
To install custom SSL certificates on Android 4.0 and later physical devices
1. If your certificate file has a .der or other extension, change it to .crt or .cer.
2. Use the Android Debug Bridge (ADB) tool to send a copy of your certificate to the SD card on the device. To do so, with the ADB running, execute the following command, where certificate is the name of your certificate:
adb push certificate.crt /sdcard/
3. On the Android device, select Settings > Location & Security Settings > Set up screen lock to ensure you have a password or screen lock for the device.
4. On the device, select Settings > Personal > Security > Credential Storage > Install from SD Card to install the custom certificate.