Android Https Connection

I got this error on Android SDK 1.1 on HTTPS connections. Hostname <> was not verified

To Fix it, just include this code bellow:

URL aURL = new URL(url);

HttpsURLConnection conn = (HttpsURLConnection) aURL.openConnection();
conn.setHostnameVerifier( new HostnameVerifier() {
public boolean verify( String hostname, SSLSession session ) {
return true;




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s