< prev index next >

test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java

Print this page




  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 // This test case relies on updated static security property, no way to re-use
  25 // security property in samevm/agentvm mode.
  26 
  27 /*
  28  * @test
  29  * @bug 8042449
  30  * @summary Issue for negative byte major record version
  31  *
  32  * @run main/othervm IllegalRecordVersion
  33  */
  34 
  35 import javax.net.ssl.*;
  36 import javax.net.ssl.SSLEngineResult.*;
  37 import java.io.*;
  38 import java.security.*;
  39 import java.nio.*;
  40 
  41 public class IllegalRecordVersion {
  42 
  43     public static void main(String args[]) throws Exception {
  44         SSLContext context = SSLContext.getDefault();
  45 
  46         SSLEngine cliEngine = context.createSSLEngine();
  47         cliEngine.setUseClientMode(true);
  48         SSLEngine srvEngine = context.createSSLEngine();
  49         srvEngine.setUseClientMode(false);
  50 
  51         SSLSession session = cliEngine.getSession();




  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 // This test case relies on updated static security property, no way to re-use
  25 // security property in samevm/agentvm mode.
  26 
  27 /*
  28  * @test
  29  * @bug 8042449
  30  * @summary Issue for negative byte major record version
  31  * @ignore the dependent implementation details are changed
  32  * @run main/othervm IllegalRecordVersion
  33  */
  34 
  35 import javax.net.ssl.*;
  36 import javax.net.ssl.SSLEngineResult.*;
  37 import java.io.*;
  38 import java.security.*;
  39 import java.nio.*;
  40 
  41 public class IllegalRecordVersion {
  42 
  43     public static void main(String args[]) throws Exception {
  44         SSLContext context = SSLContext.getDefault();
  45 
  46         SSLEngine cliEngine = context.createSSLEngine();
  47         cliEngine.setUseClientMode(true);
  48         SSLEngine srvEngine = context.createSSLEngine();
  49         srvEngine.setUseClientMode(false);
  50 
  51         SSLSession session = cliEngine.getSession();


< prev index next >