title: How to control SSLContext scope
body: <p>If I use the following code because I want to, for example, to change the way certificates are validated.</p>
  
  <p>trm = some trust manager</p>
  
  <pre><code>SSLContext sc = SSLContext.getInstance("SSL");
  sc.init(null, new TrustManager[] { trm }, null);
  HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
  </code></pre>
  
  <p>Then this sets the SSLContext for all https connections that will be made in the future regardless of what thread. What is the cleanest way to control the scope so that I set it only for those calls I want?</p>