|
49 | 49 | * @bug 8205111 |
50 | 50 | * @enablePreview |
51 | 51 | * @summary Test TLS with different types of supported keys. |
52 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256 |
53 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 |
54 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256 |
55 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256 |
56 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 |
57 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256 |
58 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384 |
| 52 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256 |
| 53 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 |
| 54 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256 |
| 55 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256 |
| 56 | + * @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 |
| 57 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256 |
| 58 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384 |
59 | 59 | * TLS_AES_128_GCM_SHA256 |
60 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512 |
| 60 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512 |
61 | 61 | * TLS_AES_128_GCM_SHA256 |
62 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256 |
63 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256 |
64 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256 |
65 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256 |
66 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256 |
67 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256 |
| 62 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256 |
| 63 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256 |
| 64 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256 |
| 65 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256 |
| 66 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256 |
| 67 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256 |
68 | 68 | * |
69 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384 |
70 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 |
71 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384 |
72 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384 |
73 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 |
74 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384 |
75 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384 |
| 69 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384 |
| 70 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 |
| 71 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384 |
| 72 | + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384 |
| 73 | + * @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 |
| 74 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384 |
| 75 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384 |
76 | 76 | * TLS_AES_256_GCM_SHA384 |
77 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512 |
| 77 | + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512 |
78 | 78 | * TLS_AES_256_GCM_SHA384 |
79 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384 |
80 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384 |
81 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384 |
82 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384 |
83 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384 |
84 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384 |
| 79 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384 |
| 80 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384 |
| 81 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384 |
| 82 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384 |
| 83 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384 |
| 84 | + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384 |
85 | 85 | * |
86 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
87 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha256 |
| 86 | + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
| 87 | + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha256 |
88 | 88 | * TLS_RSA_WITH_AES_128_CBC_SHA |
89 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha384 |
| 89 | + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha384 |
90 | 90 | * TLS_RSA_WITH_AES_256_GCM_SHA384 |
91 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha512 |
| 91 | + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha512 |
92 | 92 | * TLS_RSA_WITH_AES_128_GCM_SHA256 |
93 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ec_rsa_pkcs1_sha256 |
| 93 | + * @run main/othervm TLSTest TLSv1.2 ec_rsa_pkcs1_sha256 |
94 | 94 | * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 |
95 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_sha1 |
| 95 | + * @run main/othervm TLSTest TLSv1.2 ecdsa_sha1 |
96 | 96 | * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 |
97 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp384r1_sha384 |
| 97 | + * @run main/othervm TLSTest TLSv1.2 ecdsa_secp384r1_sha384 |
98 | 98 | * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 |
99 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp521r1_sha512 |
| 99 | + * @run main/othervm TLSTest TLSv1.2 ecdsa_secp521r1_sha512 |
100 | 100 | * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA |
101 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha256 |
| 101 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha256 |
102 | 102 | * TLS_RSA_WITH_AES_256_CBC_SHA256 |
103 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha384 |
| 103 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha384 |
104 | 104 | * TLS_RSA_WITH_AES_256_CBC_SHA |
105 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha512 |
| 105 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha512 |
106 | 106 | * TLS_RSA_WITH_AES_128_CBC_SHA256 |
107 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha256 |
| 107 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha256 |
108 | 108 | * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 |
109 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha384 |
| 109 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha384 |
110 | 110 | * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 |
111 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha512 |
| 111 | + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha512 |
112 | 112 | * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 |
113 | 113 | * |
114 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
115 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha256 |
| 114 | + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
| 115 | + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha256 |
116 | 116 | * TLS_RSA_WITH_AES_256_CBC_SHA |
117 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha384 |
| 117 | + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha384 |
118 | 118 | * TLS_RSA_WITH_AES_128_CBC_SHA |
119 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha512 |
| 119 | + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha512 |
120 | 120 | * TLS_RSA_WITH_AES_256_CBC_SHA |
121 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha256 |
| 121 | + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha256 |
122 | 122 | * TLS_RSA_WITH_AES_128_CBC_SHA |
123 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha384 |
| 123 | + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha384 |
124 | 124 | * TLS_RSA_WITH_AES_256_CBC_SHA |
125 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha512 |
| 125 | + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha512 |
126 | 126 | * TLS_RSA_WITH_AES_128_CBC_SHA |
127 | 127 | * |
128 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
129 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA |
130 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA |
131 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA |
132 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha256 |
| 128 | + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA |
| 129 | + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA |
| 130 | + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA |
| 131 | + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA |
| 132 | + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha256 |
133 | 133 | * TLS_RSA_WITH_AES_128_CBC_SHA |
134 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha384 |
| 134 | + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha384 |
135 | 135 | * TLS_RSA_WITH_AES_256_CBC_SHA |
136 | | - * @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha512 |
| 136 | + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha512 |
137 | 137 | * TLS_RSA_WITH_AES_128_CBC_SHA |
138 | 138 | */ |
139 | 139 | public class TLSTest { |
140 | 140 |
|
| 141 | + /* |
| 142 | + * Enables the JSSE system debugging system property: |
| 143 | + * |
| 144 | + * -Djavax.net.debug=ssl,handshake |
| 145 | + * |
| 146 | + * This gives a lot of low-level information about operations underway, |
| 147 | + * including specific handshake messages, and might be best examined |
| 148 | + * after gaining some familiarity with this application. |
| 149 | + */ |
| 150 | + private static final boolean debug = false; |
| 151 | + |
141 | 152 | private volatile static boolean clientRenegoReady = false; |
142 | 153 |
|
143 | 154 | public static void main(String[] args) throws Exception { |
| 155 | + if (debug) { |
| 156 | + System.setProperty("javax.net.debug", "ssl,handshake"); |
| 157 | + } |
144 | 158 |
|
145 | 159 | final String tlsProtocol = args[0]; |
146 | 160 | final KeyType keyType = KeyType.valueOf(args[1]); |
|
0 commit comments