title: Issues with setting https.protocols System Property for HTTPS connections
body: <p>I have a Java Implementation which used by various client applications to connects to to the third party systems. These third party systems supports different protocols over http/https. In this case, all client applications are hosted in the same server where my Java Implementation hosted. So,in this case, various client applications set various https protocols to the System properties (eg: <code>System.setProperty("https.protocols", "SSLv3")</code> , <code>System.setProperty("https.protocols", "TLS")</code> when they are using this to connect to those third party systems.</p>
  
  <p>Here, the System properties are shared among all the applications in that environment. So, modifying a System property leads to many problems. So, I want to know,</p>
  
  <ol>
  <li>Is there any way to get this done without using System properties?</li>
  <li>Is there any way to set all the possible https.protocols so that it
  supports any http or https connection made to the third party
  systems supports various protocols?</li>
  </ol>
  
  <p>Protocols and algorithms supported in each JDK version as mentioned in <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https" rel="noreferrer">blogs.oracle.com</a>:
  <a href="https://i.stack.imgur.com/0Th5x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0Th5x.png" alt="enter image description here"></a></p>
  
  <p><strong>Code :</strong> </p>
  
  <pre><code>String responseStr = null;
  
  System.setProperty("https.protocols",http-protocol); // This is set by the client applications. Previously, there was one by one (eg : "SSLv3". Then I changed it to "TLSv1.2,TLSv1.1,TLSv1,SSLv3" assuming it will enable all) 
  
  byteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  byteArrayOutputStream.write(requestStr.getBytes());
  
  URL mUrl = new URL(proxy_url);
  HttpURLConnection con = (HttpURLConnection) mUrl.openConnection(); // It works fine for the HttpURLConnection when there's no (s)
  
  con.setRequestMethod("POST");
  con.setDoOutput(true);
  con.setUseCaches(false);
  con.setDoInput(true);
  
  con.setRequestProperty("user-agent","Mozilla(MSIE)");
  con.setRequestProperty("Accept-Encoding","gzip,deflate");
  
  byteArrayOutputStream.writeTo(con.getOutputStream());
  
  String encodingHeader = con.getHeaderField("Content-Encoding");
  InputStream inputStream = null;
  
  if(encodingHeader != null &amp;&amp; encodingHeader.toLowerCase().indexOf("gzip") != -1){
      inputStream = new GZIPInputStream(con.getInputStream());
  }else {
      inputStream = con.getInputStream();
  
  }
  
  if (inputStream != null) {
  
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
         byte[] buffer = new byte[4096];
         int length = 0;
  
         while ((length = inputStream.read(buffer)) != -1) {
             baos.write(buffer, 0, length);
         }
  
      responseStr = new String(baos.toByteArray());
      baos.close();
  
   }
  </code></pre>
  
  <p>My Java version : 1.5</p>