@@ -101,9 +101,9 @@ public void cleanUp() {
101101 @ Test
102102 public void testCreateSSLContextWithoutCustomProtocol () throws Exception {
103103 init (caKeyType , certKeyType , keyPassword , paramIndex );
104- SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
104+ SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
105105 ByteBufAllocator byteBufAllocatorMock = mock (ByteBufAllocator .class );
106- assertEquals (new String [] { X509Util .DEFAULT_PROTOCOL } ,
106+ assertEquals (X509Util .DEFAULT_PROTOCOLS . split ( "," ) ,
107107 sslContext .newEngine (byteBufAllocatorMock ).getEnabledProtocols ());
108108 }
109109
@@ -113,7 +113,7 @@ public void testCreateSSLContextWithCustomProtocol() throws Exception {
113113 init (caKeyType , certKeyType , keyPassword , paramIndex );
114114
115115 ByteBufAllocator byteBufAllocatorMock = mock (ByteBufAllocator .class );
116- SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , protocol , null , X509Util .DEFAULT_PROTOCOL );
116+ SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , protocol , null , X509Util .DEFAULT_PROTOCOLS );
117117 assertEquals (Collections .singletonList (protocol ),
118118 Arrays .asList (sslContext .newEngine (byteBufAllocatorMock ).getEnabledProtocols ()));
119119 }
@@ -122,14 +122,14 @@ public void testCreateSSLContextWithCustomProtocol() throws Exception {
122122 public void testCreateSSLContextWithoutKeyStoreLocationServer () throws Exception {
123123 init (caKeyType , certKeyType , keyPassword , paramIndex );
124124 tlsConfigKeystoreLocation = "" ;
125- SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
125+ SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
126126 }
127127
128128 @ Test
129129 public void testCreateSSLContextWithoutKeyStoreLocationClient () throws Exception {
130130 init (caKeyType , certKeyType , keyPassword , paramIndex );
131131 tlsConfigKeystoreLocation = "" ;
132- SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
132+ SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
133133 }
134134
135135 @ Test (expected = X509Exception .class )
@@ -139,29 +139,29 @@ public void testCreateSSLContextWithoutKeyStorePassword() throws Exception {
139139 throw new X509Exception .SSLContextException ("" );
140140 }
141141 tlsConfigKeystorePassword = "" ;
142- SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
142+ SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
143143 }
144144
145145 @ Test
146146 public void testCreateSSLContextWithoutTrustStoreLocationClient () throws Exception {
147147 init (caKeyType , certKeyType , keyPassword , paramIndex );
148148 tlsConfigTrustLocation = "" ;
149- SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
149+ SslContext sslContext = X509Util .createSslContextForClient (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
150150 }
151151
152152 @ Test
153153 public void testCreateSSLContextWithoutTrustStoreLocationServer () throws Exception {
154154 init (caKeyType , certKeyType , keyPassword , paramIndex );
155155 tlsConfigTrustLocation = "" ;
156- SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
156+ SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
157157 }
158158
159159 // It would be great to test the value of PKIXBuilderParameters#setRevocationEnabled,
160160 // but it does not appear to be possible
161161 @ Test
162162 public void testCRLEnabled () throws Exception {
163163 init (caKeyType , certKeyType , keyPassword , paramIndex );
164- SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , true , false , null , null , X509Util .DEFAULT_PROTOCOL );
164+ SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , true , false , null , null , X509Util .DEFAULT_PROTOCOLS );
165165 assertTrue (Boolean .valueOf (System .getProperty ("com.sun.net.ssl.checkRevocation" )));
166166 assertTrue (Boolean .valueOf (System .getProperty ("com.sun.security.enableCRLDP" )));
167167 assertFalse (Boolean .valueOf (Security .getProperty ("ocsp.enable" )));
@@ -170,7 +170,7 @@ public void testCRLEnabled() throws Exception {
170170 @ Test
171171 public void testCRLDisabled () throws Exception {
172172 init (caKeyType , certKeyType , keyPassword , paramIndex );
173- SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOL );
173+ SslContext sslContext = X509Util .createSslContextForServer (tlsConfigKeystoreLocation , tlsConfigKeystorePassword .toCharArray (), tlsConfigKeystoreType , tlsConfigTrustLocation , tlsConfigTrustPassword .toCharArray (), tlsConfigTrustType , false , false , null , null , X509Util .DEFAULT_PROTOCOLS );
174174 assertFalse (Boolean .valueOf (System .getProperty ("com.sun.net.ssl.checkRevocation" )));
175175 assertFalse (Boolean .valueOf (System .getProperty ("com.sun.security.enableCRLDP" )));
176176 assertFalse (Boolean .valueOf (Security .getProperty ("ocsp.enable" )));
0 commit comments