Thing I am trying to do is quite simple - I want to obtain full certificate chain when connecting to a server from iOS and Android app.
In iOS, I am using NSURLSession
and overriding URLSession:didReceiveChallenge:
method in which I am able to obtain certificate chain which in this case looks like expected:
[leaf certificate] - [intermediate certificate] - [root certificate]
Lovely.
Now I am trying to do the same thing on Android device with usage of HttpsURLConnection
. After connecting to the server, I am obtaining the certificate chain (or at least I am hoping that this is the method for it) with usage of getServerCertificates()
method. This returns me Certificate[]
object in which I am getting the chain that looks like this:
[leaf certificate] - [intermediate certificate]
So, no root certificate on Android device.
Do you have any idea how to obtain root certificate from the chain in Android?
Thank you in advance.