title: Self Signed Certificate in Android
body: <p>I am able to use Self-signed certificate, which I created using openssl.</p>
  
  <p>The only problem I get while using the certificate in my <code>HttpsURLConnection</code> is of HostnameVerifier.</p>
  
  <p>If I supply my own HostnameVerifier, which always <code>return true</code> like :</p>
  
  <pre><code>HostnameVerifier hostnameVerifier = new HostnameVerifier() {
          @Override
          public boolean verify(String hostname, SSLSession session) {
              return true;
          }
      };
  </code></pre>
  
  <p>in </p>
  
  <pre><code>urlConnection.setHostnameVerifier(hostnameVerifier);
  </code></pre>
  
  <p>it works.</p>
  
  <p>Is there any way we can provide verification for our own host and not true for all ?</p>
  
  <p>AND</p>
  
  <p>Will <code>HostnameVerifier</code> work for local network (local IPs) also</p>