equal
deleted
inserted
replaced
46 * -Djdk.internal.httpclient.disableHostnameVerification=false |
46 * -Djdk.internal.httpclient.disableHostnameVerification=false |
47 * CertificateTest bad.keystore expectFailure |
47 * CertificateTest bad.keystore expectFailure |
48 * @run main/othervm |
48 * @run main/othervm |
49 * -Djdk.internal.httpclient.disableHostnameVerification=xxyyzz |
49 * -Djdk.internal.httpclient.disableHostnameVerification=xxyyzz |
50 * CertificateTest bad.keystore expectFailure |
50 * CertificateTest bad.keystore expectFailure |
|
51 * @run main/othervm CertificateTest loopback.keystore expectSuccess |
51 */ |
52 */ |
52 |
53 |
53 /** |
54 /** |
54 * The test runs a number of times. In all cases it uses a valid self-signed certificate |
55 * The test runs a number of times. In all cases it uses a valid self-signed certificate |
55 * that is installed in the trust store (so is trusted) and the same cert is supplied |
56 * that is installed in the trust store (so is trusted) and the same cert is supplied |
100 //params.setProtocols(new String[] { "TLSv1.2" }); |
101 //params.setProtocols(new String[] { "TLSv1.2" }); |
101 } |
102 } |
102 |
103 |
103 static void test(String[] args) throws Exception |
104 static void test(String[] args) throws Exception |
104 { |
105 { |
105 String uri_s = "https://localhost:" + Integer.toString(port) + "/foo"; |
106 String uri_s; |
|
107 if (args[0].equals("loopback.keystore")) |
|
108 uri_s = "https://127.0.0.1:" + Integer.toString(port) + "/foo"; |
|
109 else |
|
110 uri_s = "https://localhost:" + Integer.toString(port) + "/foo"; |
106 String error = null; |
111 String error = null; |
107 Exception exception = null; |
112 Exception exception = null; |
108 System.out.println("Making request to " + uri_s); |
113 System.out.println("Making request to " + uri_s); |
109 HttpClient client = HttpClient.newBuilder() |
114 HttpClient client = HttpClient.newBuilder() |
110 .sslContext(ctx) |
115 .sslContext(ctx) |