Fla*_*h99 6 android urlconnection httpclient httpsurlconnection
在android中,我想建立一个到HTTPS URL的URL连接.连接打开后,我希望能够从服务器读取证书并获取已发布的通用名称和组织字符串?
这可能吗?如果是这样,最好的方法是什么?
到目前为止,我一直在使用HttpsUrlConnection:
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
urlConnection.getInputStream();
X509Certificate cert = (X509Certificate) urlConnection.getServerCertificates()[0];
Run Code Online (Sandbox Code Playgroud)
但在此之后,我不确定如何获得具体的证书细节?如果这是正确的方法,我甚至不确定.
| 归档时间: |
|
| 查看次数: |
761 次 |
| 最近记录: |