title: Https Website using HttpURLConnection
body: <p>I have a question regarding using an <code>HttpUrlConnection</code> with a https web service.</p>
  
  <p>Basically, we had previously written a bunch of web services to be used in an Android application that were all http calls. We want to change those over to use https instead. Basically, what I'm concerned with, is will my existing code work properly? I had previously created a connection like the following:</p>
  
  <pre><code>HttpURLConnection myConnection = (HttpURLConnection) myURL.openConnection();
  myConnection.setConnectTimeout(TIMEOUT_MILLISEC);
  myConnection.connect();
  </code></pre>
  
  <p>This appears to be working fine with the new https web services, but I'm wondering why I don't need to change it to something like this:</p>
  
  <pre><code>HttpsURLConnection myConnection = (HttpsURLConnection) myURL.openConnection();
  myConnection.setConnectTimeout(TIMEOUT_MILLISEC);
  myConnection.setSSLSocketFactory(createSSLSocketFactory());
  myConnection.connect();
  </code></pre>
  
  <p>I'm still planning on moving to a <code>HttpsURLConnection</code> instead, but I'm curious how older versions of our app will be affected by our intended changes.</p>
  
  <p>Thanks for the help!</p>