I have initiated an HTTPS connection using something like 

```
httpsCert.connect();

```

where httpsCert is `HttpsURLConnection httpsCert`.

Now I do something like `Certificate[] certs = httpsCert.getServerCertificates();` to retrieve the server x.509 certificates. 

> 
> I want to retrieve which root CA or the intermediary CA signed the certificate received above. 
> 
> 
> 

My approach has been to look at the issuer field in the certificate received above, but is it a good approach. I mean is there a better approach of doing this ?

Secondly, from [developer.android.com/HttpsUrlConnection](http://developer.android.com/reference/javax/net/ssl/HttpsURLConnection.html#getServerCertificates()), it appears that getServerCertificates () would return **the list of certificates identifying the peer with the peer's identity certificate followed by CAs.** In this context, in case of some certificates, like certificates fetched by Google apps, there is a section of the certificate that says **Authority Information Access: 
 CA Issuers - URI:<http://pki.google.com/GIAG2.crt>** however this is not the case with other apps fetching certificates signed by other authorities. 

> 
> Second question is how does Android validate the certificate path for certificates signed by intermediary CAs ?
> 
> 
>