All I need to do is download some basic text-based and image files from a web server that has a self-signed SSL certificate.
I have been trying to figure out how to use HttpClient to do this, but getting the SSL to work is a nightmare that seems to be way too much trouble for such a simple task.
Is there a better way to perform these file downloads? Perhaps through a WebView or Browser feature? Reinventing the wheel of making a simple HTTPS GET request is a major pain, and is significantly holding up my development schedule.
Self-signed SSL certificates are not trusted by browsers, because they are generated by your servers, and not validated by trusted CAs, like Cloudflare and Go Daddy.
Self signed certificates are not strictly worse than certificates signed by a reputable CA, and in all technical ways they are better than plain HTTP. From the signing and encryption perspective they are identical. Both can sign and encrypt traffic so that it is not feasible for others to snoop or make modifications.
Self-signed SSL Certificates are risky because they have no validation from a third-party authority, which is usually a Trusted SSL Certificate Company. Developers and businesses try to save money by using or creating a free Self-Signed SSL Certificate.
I found two great examples of how to accept self-signed SSL certificates, one each for HttpsURLConnection and HttpClient.
HttpsURLConnection solution: Https Connection Android
HttpClient solution: Self-signed SSL acceptance on Android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With