equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2014, 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. |
33 */ |
33 */ |
34 |
34 |
35 import javax.net.*; |
35 import javax.net.*; |
36 import javax.net.ssl.*; |
36 import javax.net.ssl.*; |
37 import java.util.Arrays; |
37 import java.util.Arrays; |
|
38 import java.security.Security; |
38 |
39 |
39 public class NoOldVersionContext { |
40 public class NoOldVersionContext { |
40 static enum ContextVersion { |
41 static enum ContextVersion { |
41 TLS_CV_01("SSL", |
42 TLS_CV_01("SSL", |
42 new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"}), |
43 new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"}), |
91 |
92 |
92 return success; |
93 return success; |
93 } |
94 } |
94 |
95 |
95 public static void main(String[] args) throws Exception { |
96 public static void main(String[] args) throws Exception { |
|
97 // reset the security property to make sure that the algorithms |
|
98 // and keys used in this test are not disabled. |
|
99 Security.setProperty("jdk.tls.disabledAlgorithms", ""); |
|
100 |
96 boolean failed = false; |
101 boolean failed = false; |
97 for (ContextVersion cv : ContextVersion.values()) { |
102 for (ContextVersion cv : ContextVersion.values()) { |
98 System.out.println("Checking SSLContext of " + cv.contextVersion); |
103 System.out.println("Checking SSLContext of " + cv.contextVersion); |
99 SSLContext context = SSLContext.getInstance(cv.contextVersion); |
104 SSLContext context = SSLContext.getInstance(cv.contextVersion); |
100 |
105 |