title: javax.net.ssl.SSLException: SSLSocketFactory is null
body: <p>I have a problem with the following code...</p>
  
  <pre><code>System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
  System.setProperty("javax.net.ssl.trustStoreType", "jks");
  System.setProperty("javax.net.ssl.keyStore","C:\\ClientKeyStore\\ClientKeyStore.p12");
  System.setProperty("javax.net.ssl.trustStore","C:\\ClientKeyStore\\ClientKeyStore.keystore");
  System.setProperty("javax.net.debug", "ssl");
  System.setProperty("javax.net.ssl.keyStorePassword", "keystorepass");
  System.setProperty("javax.net.ssl.trustStorePassword", "truststorepass");
  
  SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
  URL url = new URL("https://url.com");
  HttpsURLConnection httpCon = (HttpsURLConnection) url.openConnection();
  httpCon.setSSLSocketFactory(sslsocketfactory);
  OutputStream out=httpCon.getOutputStream();
  </code></pre>
  
  <p>I tried to set the trust store, keystore and other properties of SSL context using the <code>System.setProperty(key,value)</code> method, but I'm getting the following error.</p>
  
  <pre><code>javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a socket and javax.net.ssl.* properties are not set.
  </code></pre>
  
  <p>Could someone please help me with this problem.</p>