ShortRSAKeyWithinTLS.java revision 5706
4589N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4589N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4589N/A * This code is free software; you can redistribute it and/or modify it 4589N/A * under the terms of the GNU General Public License version 2 only, as 4589N/A * published by the Free Software Foundation. 4589N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4589N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4589N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4589N/A * version 2 for more details (a copy is included in the LICENSE file that 4589N/A * You should have received a copy of the GNU General Public License version 4589N/A * 2 along with this work; if not, write to the Free Software Foundation, 4589N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4589N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4589N/A * or visit www.oracle.com if you need additional information or have any 4589N/A * ============================================================= 4589N/A * Set the various variables needed for the tests, then 4589N/A * specify what tests to run on each side. 4589N/A * Should we run the client or server in a separate thread? 4589N/A * Both sides can throw exceptions, but do you have a preference 4589N/A * as to which side should be the main thread. 4589N/A * Is the server ready to serve? 4589N/A * If the client or server is doing some kind of object creation 4589N/A * that the other side depends on, and that thread prematurely 4589N/A * exits, you may experience a hang. The test harness will 4589N/A * terminate all hung threads after its timeout has expired, 4589N/A * currently 3 minutes by default, but you might try to be 4589N/A * Define the server side of the test. 4589N/A * If the server prematurely exits, serverReady will be set to true 4589N/A // initialize the SSLContext 4589N/A * Signal Client, we're ready for his connect. 4589N/A * Define the client side of the test. 4589N/A * If the server prematurely exits, serverReady will be set to true 4589N/A * Wait for server to get started. 4589N/A // initialize the SSLContext 4589N/A * ============================================================= 4589N/A * The remainder is just support stuff 4589N/A // use any free port by default 4589N/A // Get the customized arguments. 4589N/A * Primary constructor, used to drive remainder of the test. 4589N/A * Fork off the other side, then do your work. 4589N/A // swallow for now. Show later 4589N/A * Wait for other side to close down. 4589N/A * When we get here, the test is pretty much over. 4589N/A * Which side threw the error? 4589N/A * If both failed, return the curthread's exception, but also 4589N/A * print the remote side Exception 4589N/A * Our server thread just died. 4589N/A * Release the client, if not active already... 4589N/A * Our client thread just died.