title: SSL Socket connect timeout
body: <p>How can I configure connect timeout for SSL Sockets in Java?</p>
  
  <p>For plain sockets, I can simply create new socket instance without any target endpoint using <code>new Socket()</code>, and then call <a href="http://download.oracle.com/javase/6/docs/api/java/net/Socket.html#connect(java.net.SocketAddress,%20int)" rel="noreferrer">connect(SocketAddress endpoint, int timeout)</a> method. With SSL sockets, I cannot create <code>new SSLSocket()</code> and <code>SSLSocketFactory.getDefault().createSocket()</code> method with no endpoint throws <code>UnsupportedOperationException</code> with <strong>Unconnected sockets not implemented</strong> message.</p>
  
  <p>Is there a way to use connect timeouts for SSL Sockets in Java, using standard java libs only?</p>