CipherTest.java revision 2998
2362N/A * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 1096N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1096N/A * This code is free software; you can redistribute it and/or modify it 1096N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. 2362N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1096N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1096N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1096N/A * version 2 for more details (a copy is included in the LICENSE file that 1096N/A * You should have received a copy of the GNU General Public License version 1096N/A * 2 along with this work; if not, write to the Free Software Foundation, 1096N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1096N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1096N/A * or visit www.oracle.com if you need additional information or have any 1096N/A * Test that all ciphersuites work in all versions and all client 1096N/A * authentication types. The way this is setup the server is stateless and 1096N/A * all checking is done on the client side. 1096N/A * The test is multithreaded to speed it up, especially on multiprocessor 1096N/A * machines. To simplify debugging, run with -DnumThreads=1. 1096N/A // use any available port for the server socket // assume that if we do not read anything for 20 seconds, something final static int TIMEOUT =
20 *
1000;
public abstract void run();
// 2nd newline in a row, end of request // ignore exportable cipher suite for TLSv1.1 s +=
" with " +
clientAuth +
" client authentication";
// String[] clientAuths = {null, "RSA", "DSA"}; // no client with anonymous ciphersuites for (
int i =
0; i <
THREADS; i++) {
for (
int i =
0; i <
THREADS; i++) {
"' completed successfully");
public final void run() {
// for some reason, ${test.src} has a different value when the // test is called from the script and when it is called directly... // secureRandom = new SecureRandom(); // secureRandom.nextInt(); // trustStore = readKeyStore(trustStoreFile); // keyStore = readKeyStore(keyStoreFile); // trustManager = new AlwaysTrustManager(); // skip kerberos cipher suites // skip SSLv2Hello protocol // ignore exportable cipher suite for TLSv1.1 // we currently don't do any chain verification. we assume that works ok // and we can speed up the test. we could also just add a plain certificate // chain comparision with our trusted certificates.