< prev index next >

test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 19,31 ***
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
  import javax.net.ssl.*;
  import java.io.IOException;
  import java.net.Socket;
  import java.nio.charset.StandardCharsets;
- import java.nio.file.Path;
  import java.security.Security;
  import java.util.List;
  
  /*
   * @test id=Server
   * @bug 8301379
   * @summary Verify that Java will not negotiate disabled cipher suites when the
   * other side of the connection requests them.
   *
   * @library /javax/net/ssl/templates
   * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server true
   */
  
  /*
   * @test id=Client
   * @bug 8301379
   * @summary Verify that Java will not negotiate disabled cipher suites when the
   * other side of the connection requests them.
   *
   * @library /javax/net/ssl/templates
   * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server false
--- 19,34 ---
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
+ import jdk.test.lib.process.ProcessTools;
+ 
  import javax.net.ssl.*;
  import java.io.IOException;
  import java.net.Socket;
  import java.nio.charset.StandardCharsets;
  import java.security.Security;
  import java.util.List;
  
  /*
   * @test id=Server
   * @bug 8301379
+  * @library /test/lib
   * @summary Verify that Java will not negotiate disabled cipher suites when the
   * other side of the connection requests them.
   *
   * @library /javax/net/ssl/templates
   * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server true
   */
  
  /*
   * @test id=Client
   * @bug 8301379
+  * @library /test/lib
   * @summary Verify that Java will not negotiate disabled cipher suites when the
   * other side of the connection requests them.
   *
   * @library /javax/net/ssl/templates
   * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server false

*** 59,17 ***
          }
  
          if (args[0].equals("server")) {
              try (TLSServer server = new TLSServer(useDisabledAlgo)) {
                  List<String> command = List.of(
-                         Path.of(System.getProperty("java.home"), "bin", "java").toString(),
                          "TLSWontNegotiateDisabledCipherAlgos",
                          "client",
                          Boolean.toString(!useDisabledAlgo),
                          Integer.toString(server.getListeningPort())
                  );
!                 ProcessBuilder builder = new ProcessBuilder(command);
                  Process p = builder.inheritIO().start();
                  server.run();
                  p.destroy();
              }
          } else if (args[0].equals("client")) {
--- 62,16 ---
          }
  
          if (args[0].equals("server")) {
              try (TLSServer server = new TLSServer(useDisabledAlgo)) {
                  List<String> command = List.of(
                          "TLSWontNegotiateDisabledCipherAlgos",
                          "client",
                          Boolean.toString(!useDisabledAlgo),
                          Integer.toString(server.getListeningPort())
                  );
!                 ProcessBuilder builder = ProcessTools.createTestJavaProcessBuilder(command);
                  Process p = builder.inheritIO().start();
                  server.run();
                  p.destroy();
              }
          } else if (args[0].equals("client")) {
< prev index next >