HttpsURLConnection conn;
try {
URL url = new URL(httpsHost);
conn = (HttpsURLConnection)url.openConnection();
conn.connect();
} catch(MalformedURLException e) {
System.err.printf("Malformed URL '%s'.\n", httpsHost);
return;
} catch(SocketTimeoutException e) {
System.err.printf("Connection to '%s' timed out.\n", httpsHost);