1 /* |
1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
|
24 // SunJSSE does not support dynamic system properties, no way to re-use |
|
25 // system properties in samevm/agentvm mode. |
|
26 |
24 /* |
27 /* |
25 * @test |
28 * @test |
26 * @bug 4474255 |
29 * @bug 4474255 4484246 |
27 * @test 1.1 01/06/27 |
|
28 * @bug 4484246 |
|
29 * @summary When an application enables anonymous SSL cipher suite, |
30 * @summary When an application enables anonymous SSL cipher suite, |
30 * Hostname verification is not required |
31 * Hostname verification is not required |
31 * @run main/othervm JavaxHostnameVerifier |
32 * @run main/othervm JavaxHostnameVerifier |
32 * |
|
33 * SunJSSE does not support dynamic system properties, no way to re-use |
|
34 * system properties in samevm/agentvm mode. |
|
35 */ |
33 */ |
36 |
34 |
37 import java.io.*; |
35 import java.io.*; |
38 import java.net.*; |
36 import java.net.*; |
|
37 import java.security.Security; |
39 import java.security.cert.*; |
38 import java.security.cert.*; |
40 import javax.net.ssl.*; |
39 import javax.net.ssl.*; |
41 |
40 |
42 /** |
41 /** |
43 * Use javax.net.ssl.HostnameVerifier |
42 * Use javax.net.ssl.HostnameVerifier |
242 |
241 |
243 volatile Exception serverException = null; |
242 volatile Exception serverException = null; |
244 volatile Exception clientException = null; |
243 volatile Exception clientException = null; |
245 |
244 |
246 public static void main(String[] args) throws Exception { |
245 public static void main(String[] args) throws Exception { |
|
246 // re-enable 3DES |
|
247 Security.setProperty("jdk.tls.disabledAlgorithms", ""); |
247 |
248 |
248 if (debug) |
249 if (debug) |
249 System.setProperty("javax.net.debug", "all"); |
250 System.setProperty("javax.net.debug", "all"); |
250 |
251 |
251 /* |
252 /* |