test/jdk/sun/security/ssl/SSLContextImpl/CustomizedCipherSuites.java
changeset 51465 e4ba2cfcfa92
parent 47216 71c04702a3d5
child 52286 d98fb44ad6bf
equal deleted inserted replaced
51464:d96e6839e83d 51465:e4ba2cfcfa92
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    29  * @bug 8162362
    29  * @bug 8162362
    30  * @summary Cannot enable previously default enabled cipher suites
    30  * @summary Cannot enable previously default enabled cipher suites
    31  * @run main/othervm
    31  * @run main/othervm
    32  *      CustomizedCipherSuites Default true
    32  *      CustomizedCipherSuites Default true
    33  *      TLS_RSA_WITH_AES_128_CBC_SHA
    33  *      TLS_RSA_WITH_AES_128_CBC_SHA
    34  *      SSL_RSA_WITH_DES_CBC_SHA
    34  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    35  * @run main/othervm
    35  * @run main/othervm
    36  *      -Djdk.tls.client.cipherSuites="unknown"
    36  *      -Djdk.tls.client.cipherSuites="unknown"
    37  *      CustomizedCipherSuites Default true
    37  *      CustomizedCipherSuites Default true
    38  *      TLS_RSA_WITH_AES_128_CBC_SHA
    38  *      TLS_RSA_WITH_AES_128_CBC_SHA
    39  *      SSL_RSA_WITH_DES_CBC_SHA
    39  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    40  * @run main/othervm
    40  * @run main/othervm
    41  *      -Djdk.tls.client.cipherSuites=""
    41  *      -Djdk.tls.client.cipherSuites=""
    42  *      CustomizedCipherSuites Default true
    42  *      CustomizedCipherSuites Default true
    43  *      TLS_RSA_WITH_AES_128_CBC_SHA
    43  *      TLS_RSA_WITH_AES_128_CBC_SHA
    44  *      SSL_RSA_WITH_DES_CBC_SHA
    44  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    45  * @run main/othervm
    45  * @run main/othervm
    46  *      -Djdk.tls.client.cipherSuites="SSL_RSA_WITH_DES_CBC_SHA"
    46  *      -Djdk.tls.client.cipherSuites="TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    47  *      CustomizedCipherSuites Default true
    47  *      CustomizedCipherSuites Default true
    48  *      SSL_RSA_WITH_DES_CBC_SHA
    48  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    49  *      TLS_RSA_WITH_AES_128_CBC_SHA
    49  *      TLS_RSA_WITH_AES_128_CBC_SHA
    50  * @run main/othervm
    50  * @run main/othervm
    51  *      -Djdk.tls.server.cipherSuites="SSL_RSA_WITH_DES_CBC_SHA"
    51  *      -Djdk.tls.server.cipherSuites="TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    52  *      CustomizedCipherSuites Default false
    52  *      CustomizedCipherSuites Default false
    53  *      SSL_RSA_WITH_DES_CBC_SHA
    53  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    54  *      TLS_RSA_WITH_AES_128_CBC_SHA
    54  *      TLS_RSA_WITH_AES_128_CBC_SHA
    55  * @run main/othervm
    55  * @run main/othervm
    56  *      -Djdk.tls.client.cipherSuites="TLS_RSA_WITH_AES_128_CBC_SHA,unknown,SSL_RSA_WITH_DES_CBC_SHA"
    56  *      -Djdk.tls.client.cipherSuites="TLS_RSA_WITH_AES_128_CBC_SHA,unknown,TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    57  *      CustomizedCipherSuites Default true
    57  *      CustomizedCipherSuites Default true
    58  *      SSL_RSA_WITH_DES_CBC_SHA
    58  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    59  *      ""
    59  *      ""
    60  * @run main/othervm
    60  * @run main/othervm
    61  *      -Djdk.tls.server.cipherSuites="TLS_RSA_WITH_AES_128_CBC_SHA,unknown,SSL_RSA_WITH_DES_CBC_SHA"
    61  *      -Djdk.tls.server.cipherSuites="TLS_RSA_WITH_AES_128_CBC_SHA,unknown,TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    62  *      CustomizedCipherSuites Default false
    62  *      CustomizedCipherSuites Default false
    63  *      TLS_RSA_WITH_AES_128_CBC_SHA
    63  *      TLS_RSA_WITH_AES_128_CBC_SHA
    64  *      ""
    64  *      ""
    65  * @run main/othervm
    65  * @run main/othervm
    66  *      -Djdk.tls.server.cipherSuites="SSL_RSA_WITH_DES_CBC_SHA"
    66  *      -Djdk.tls.server.cipherSuites="TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    67  *      CustomizedCipherSuites Default true
    67  *      CustomizedCipherSuites Default true
    68  *      TLS_RSA_WITH_AES_128_CBC_SHA
    68  *      TLS_RSA_WITH_AES_128_CBC_SHA
    69  *      SSL_RSA_WITH_DES_CBC_SHA
    69  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    70  * @run main/othervm
    70  * @run main/othervm
    71  *      -Djdk.tls.client.cipherSuites="SSL_RSA_WITH_DES_CBC_SHA"
    71  *      -Djdk.tls.client.cipherSuites="TLS_ECDH_anon_WITH_AES_128_CBC_SHA"
    72  *      CustomizedCipherSuites Default false
    72  *      CustomizedCipherSuites Default false
    73  *      TLS_RSA_WITH_AES_128_CBC_SHA
    73  *      TLS_RSA_WITH_AES_128_CBC_SHA
    74  *      SSL_RSA_WITH_DES_CBC_SHA
    74  *      TLS_ECDH_anon_WITH_AES_128_CBC_SHA
    75  */
    75  */
    76 
    76 
    77 import javax.net.ssl.*;
    77 import javax.net.ssl.*;
    78 
    78 
    79 /**
    79 /**
    80  * Test the customized default cipher suites.
    80  * Test the customized default cipher suites.
    81  *
    81  *
    82  * This test is based on the behavior that SSL_RSA_WITH_DES_CBC_SHA is
    82  * This test is based on the behavior that TLS_ECDH_anon_WITH_AES_128_CBC_SHA is
    83  * disabled by default, and TLS_RSA_WITH_AES_128_CBC_SHA is enabled by
    83  * disabled by default, and TLS_RSA_WITH_AES_128_CBC_SHA is enabled by
    84  * default in JDK.  If the behavior is changed in the future, please
    84  * default in JDK.  If the behavior is changed in the future, please
    85  * update the test cases above accordingly.
    85  * update the test cases above accordingly.
    86  */
    86  */
    87 public class CustomizedCipherSuites {
    87 public class CustomizedCipherSuites {