Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS with Self-Signed SSL Certificate Issues... Solution or better way?

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.

like image 822
stormin986 Avatar asked Apr 29 '10 21:04

stormin986


People also ask

Is HTTPS with self-signed certificate secure?

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.

Is self-signed certificate better than HTTP?

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.

What is a disadvantage of a self-signed SSL certificate?

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.


1 Answers

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

like image 92
stormin986 Avatar answered Oct 20 '22 12:10

stormin986