Package javax.net.ssl

Examples of javax.net.ssl.HttpsURLConnection.connect()


        HttpsURLConnection conn = (HttpsURLConnection) getRemoteURL().openConnection();
        conn.setDoOutput(false);
        conn.setDoInput(true);
        conn.setRequestMethod("GET");
        configureConnection(conn);
        conn.connect();
        return conn;
    }

}
View Full Code Here


                sc.init(keyMgr, trustAllCerts, new java.security.SecureRandom());
                HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
                HttpsURLConnection urlCon = (HttpsURLConnection)url.openConnection();
                urlCon.setConnectTimeout(connectTimeout);
                urlCon.setReadTimeout(timeoutInSeconds*1000);
                urlCon.connect();
                InputStream buffer = urlCon.getInputStream();
                buffer.read();
            } else {
                //non-ssl connection
                urlString = HTTP_PROTOCOL + address + ":" + listenerPort + "/";
View Full Code Here

                             new Object[]{server.getName(),urlString});

                HttpURLConnection urlCon = (HttpURLConnection)url.openConnection();
                urlCon.setConnectTimeout(connectTimeout);
                urlCon.setReadTimeout(timeoutInSeconds*1000);
                urlCon.connect();
                InputStream buffer = urlCon.getInputStream();
                buffer.read();
            }
        } catch (MalformedURLException ex) {
            //nop
View Full Code Here

            public boolean verify(String hostname, SSLSession session) {
                return true;
            }}
        );

        conn.connect();
        read(conn.getInputStream());
       
        service.stop();
        assertTrue(servlet.invoked);
View Full Code Here

        nnUri.getPort(), path + '?' + query);
    HttpsURLConnection conn = (HttpsURLConnection)URLUtils.openConnection(url);
    // bypass hostname verification
    conn.setHostnameVerifier(new DummyHostnameVerifier());
    conn.setRequestMethod("GET");
    conn.connect();

    // check cert expiration date
    final int warnDays = ExpWarnDays;
    if (warnDays > 0) { // make sure only check once
      ExpWarnDays = 0;
View Full Code Here

    Set<String> hostsList = hostsReader.getHosts();
    for (String hostname : hostsList) {
      HttpsURLConnection connection = null;
      try {
        connection = openConnection(hostname, sslPort, path);
        connection.connect();
        if (connection.getResponseCode() != HttpServletResponse.SC_OK) {
          b.append("\n\t" + hostname + ": " + connection.getResponseCode()
              + " " + connection.getResponseMessage());
          err++;
        }
View Full Code Here

            // check the connection state
            checkConnectionStateParameters(connection, peerSocket);

            // should silently exit
            connection.connect();
        } finally {
            // roll the properties back to system values
            tearDownStoreProperties();
        }
    }
View Full Code Here

            // check the connection state
            checkConnectionStateParameters(connection, peerSocket);

            // should silently exit
            connection.connect();
        } finally {
            // roll the properties back to system values
            tearDownStoreProperties();
        }
    }
View Full Code Here

                            + e.getMessage());
                }
            }

            // should silently exit
            connection.connect();
        } finally {
            // roll the properties back to system values
            tearDownStoreProperties();
        }
    }
View Full Code Here

        assertSame("Default SSLSocketFactory should be used",
                HttpsURLConnection.getDefaultSSLSocketFactory(), connection
                        .getSSLSocketFactory());

        // should silently exit
        connection.connect();
    }

    /**
     * Tests possibility to set up the SSLSocketFactory
     * to be used by HttpsURLConnection.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.