Home | History | Annotate | Download | only in cts

Lines Matching refs:port

48     public static void assertTlsConnectionSucceeds(String host, int port) throws Exception {
49 assertSslSocketSucceeds(host, port);
50 assertHttpClientSucceeds(host, port, true /* https */);
51 assertUrlConnectionSucceeds(host, port, true /* https */);
54 public static void assertTlsConnectionFails(String host, int port) throws Exception {
55 assertSslSocketFails(host, port);
56 assertHttpClientFails(host, port, true /* https */);
57 assertUrlConnectionFails(host, port, true /* https */);
60 public static void assertCleartextConnectionSucceeds(String host, int port) throws Exception {
61 assertHttpClientSucceeds(host, port, false /* http */);
62 assertUrlConnectionSucceeds(host, port, false /* http */);
65 public static void assertCleartextConnectionFails(String host, int port) throws Exception {
66 assertHttpClientFails(host, port, false /* http */);
67 assertUrlConnectionFails(host, port, false /* http */);
91 private static void assertSslSocketFails(String host, int port)
94 Socket s = SSLContext.getDefault().getSocketFactory().createSocket(host, port);
96 fail("Connection to " + host + ":" + port + " succeeded");
101 private static void assertSslSocketSucceeds(String host, int port)
103 Socket s = SSLContext.getDefault().getSocketFactory().createSocket(host, port);
107 private static void assertUrlConnectionFails(String host, int port, boolean https)
109 URL url = new URL((https ? "https://" : "http://") + host + ":" + port);
113 fail("Connection to " + host + ":" + port + " succeeded");
118 private static void assertUrlConnectionSucceeds(String host, int port, boolean https)
120 URL url = new URL((https ? "https://" : "http://") + host + ":" + port);
125 private static void assertHttpClientSucceeds(String host, int port, boolean https)
127 URL url = new URL((https ? "https://" : "http://") + host + ":" + port);
136 private static void assertHttpClientFails(String host, int port, boolean https)
138 URL url = new URL((https ? "https://" : "http://") + host + ":" + port);
142 fail("Connection to " + host + ":" + port + " succeeded");