Provide own root-certificate for HTTPS-connection?

2019-09-01 04:16发布

currently my app connects to a (special) webserver via HTTP to retrieve some data from there via GET/POST and HttpClient.

Now I plan to switch over to HTTPS. My problem: the webpage I'm communicating with uses a CACert root certificate which is not available on all Android devices, so for most users this connection will fail.

CACert provides their root certificates at http://www.cacert.org/index.php?id=3&lang=en . Is there a possibility to use these certificates for my HTTPS connection? I don't expect to install it silently for the whole system, for me it would be enough to provide it just for my special HttpClient connection.

Thanks!

1条回答
家丑人穷心不美
2楼-- · 2019-09-01 04:32

OK, found a solution including code example here: http://developer.android.com/training/articles/security-ssl.html

查看更多
登录 后发表回答