4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 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 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @bug 6223624 27 * @summary SSLSocket.setUseClientMode() fails to throw expected 28 * IllegalArgumentException 29 * @run main/othervm SetClientMode 30 * 31 * SunJSSE does not support dynamic system properties, no way to re-use 32 * system properties in samevm/agentvm mode. 33 */ 34 35 /* 36 * Attempts to replicate a TCK test failure which creates SSLServerSockets 37 * and then runs client threads which connect and start handshaking. Once 38 * handshaking is begun the server side attempts to invoke 39 * SSLSocket.setUseClientMode() on one or the other of the ends of the 40 * connection, expecting an IllegalArgumentException. 41 * 42 * If the server side of the connection tries setUseClientMode() we 43 * see the expected exception. If the setting is tried on the 44 * client side SSLSocket, we do *not* see the exception, except 45 * occasionally on the very first iteration. 46 */ 47 48 import java.io.*; 49 import java.lang.*; 50 import java.net.*; 51 import javax.net.ssl.*; 52 import java.security.*; | 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 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 21 * questions. 22 */ 23 24 // SunJSSE does not support dynamic system properties, no way to re-use 25 // system properties in samevm/agentvm mode. 26 27 /* 28 * @test 29 * @bug 6223624 30 * @ignore this test does not grant to work. The handshake may have completed 31 * when getSession() return. Please update or remove this test case. 32 * @summary SSLSocket.setUseClientMode() fails to throw expected 33 * IllegalArgumentException 34 * @run main/othervm SetClientMode 35 */ 36 37 /* 38 * Attempts to replicate a TCK test failure which creates SSLServerSockets 39 * and then runs client threads which connect and start handshaking. Once 40 * handshaking is begun the server side attempts to invoke 41 * SSLSocket.setUseClientMode() on one or the other of the ends of the 42 * connection, expecting an IllegalArgumentException. 43 * 44 * If the server side of the connection tries setUseClientMode() we 45 * see the expected exception. If the setting is tried on the 46 * client side SSLSocket, we do *not* see the exception, except 47 * occasionally on the very first iteration. 48 */ 49 50 import java.io.*; 51 import java.lang.*; 52 import java.net.*; 53 import javax.net.ssl.*; 54 import java.security.*; |