It will be very easy to setup & learn SSL if you go with a local server.
1 ] Setup a Server (For Eg; TomCat) for SSL communications (https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html).
2 ] Write a simple Web-Service (http://www.radcortez.com/ssl-tls-rest-server-client-with-spring-and-tomee/).
3 ] Prepare a self -signed certificate using any one of the tool (Keytool , OpenSSL etc)
4 ] It is adviced to use commands to create keystore,certificate etc.But for the lazy people there is a GUI based program :) (http://keystore-explorer.org/downloads.html)
5 ] Now ,It's time to pin SSL certificate to Android Applications.Add your aliasname.cer (It can export from s/w mentioned in point [4])
6 ] Check host name programatically (https://infinum.co/the-capsized-eight/securing-mobile-banking-on-android-with-ssl-certificate-pinning).
7 ] Create a custom Trust Manager,So that we , can omit android system's default Trust Manager (https://github.com/ikust/hello-pinnedcerts)
Answer from Don Chakkappan on Stack OverflowVideos
Prior to Android KitKat you have to root your device to install new certificates.
From Android KitKat (4.0) up to Marshmallow (6.0) it's possible and easy. I was able to install the Charles Web Debbuging Proxy cert on my un-rooted device and successfully sniff SSL traffic.
Extract from http://wiki.cacert.org/FAQ/ImportRootCert
Before Android version 4.0, with Android version Gingerbread & Froyo, there was a single read-only file ( /system/etc/security/cacerts.bks ) containing the trust store with all the CA ('system') certificates trusted by default on Android. Both system apps and all applications developed with the Android SDK use this. Use these instructions on installing CAcert certificates on Android Gingerbread, Froyo, ...
Starting from Android 4.0 (Android ICS/'Ice Cream Sandwich', Android 4.3 'Jelly Bean' & Android 4.4 'KitKat'), system trusted certificates are on the (read-only) system partition in the folder '/system/etc/security/' as individual files. However, users can now easily add their own 'user' certificates which will be stored in '/data/misc/keychain/certs-added'.
System-installed certificates can be managed on the Android device in the Settings -> Security -> Certificates -> 'System'-section, whereas the user trusted certificates are manged in the 'User'-section there. When using user trusted certificates, Android will force the user of the Android device to implement additional safety measures: the use of a PIN-code, a pattern-lock or a password to unlock the device are mandatory when user-supplied certificates are used.
Installing CAcert certificates as 'user trusted'-certificates is very easy. Installing new certificates as 'system trusted'-certificates requires more work (and requires root access), but it has the advantage of avoiding the Android lockscreen requirement.
From Android N (7.0) onwards it gets a littler harder, see this extract from the Charles proxy website:
As of Android N, you need to add configuration to your app in order to have it trust the SSL certificates generated by Charles SSL Proxying. This means that you can only use SSL Proxying with apps that you control.
In order to configure your app to trust Charles, you need to add a Network Security Configuration File to your app. This file can override the system default, enabling your app to trust user installed CA certificates (e.g. the Charles Root Certificate). You can specify that this only applies in debug builds of your application, so that production builds use the default trust profile.
Add a file res/xml/network_security_config.xml to your app:
<network-security-config>
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
Then add a reference to this file in your app's manifest, as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application android:networkSecurityConfig="@xml/network_security_config">
</application>
</manifest>
I spent a lot of time trying to find an answer to this (I need Android to see StartSSL certificates). Conclusion: Android 2.1 and 2.2 allow you to import certificates, but only for use with WiFi and VPN. There is no user interface for updating the list of trusted root certificates, but there is discussion about adding that feature. It’s unclear whether there is a reliable workaround for manually updating and replacing the cacerts.bks file.
Details and links: http://www.mcbsys.com/techblog/2010/12/android-certificates/. In that post, see the link to Android bug 11231--you might want to add your vote and query to that bug.
I have an OpenSSL self signed cert that I use for self hosted services. I want to load it on my Android device so that I don't have to click through the cert warnings on web pages. No matter what I do, I just can't get it to work. I am using Android 13, Firefox Android, and a wildcard cert. Has anyone had success doing this?
Edit: Some additional summarized details:
Android 13
The device is fully up to date with what updates are accessible
Firefox Android 141.0.1
Tried importing in .cert and .pem formats
Tried importing from internal and SD card format
Tried importing through CA certificate setting and Files app
Main issue is that when attempting to import the cert, the settings app returns to the certificates page with no success/error message, as if it has crashed. This occurs after the workflow of selecting the cert file.