I am following android's tutorial of https with untrusted certificate. See here.
They have provided sample code of the scenario when CA is untrusted. I have the scenario of self-signed certificate on my server. So I can't figure out what I do replace the following with in their sample code :
InputStream caInput = new BufferedInputStream(new FileInputStream("load-der.crt"));
// I can't figure out where to get my crt from ?
// I don't have access to that path directly from a URL
For self signed certificate they say :
You can create your own TrustManager, this time trusting
the server certificate directly.
Do I have separately get my server's self-signed certificate ? Will the API not get that for me automatically in some way ?