6161import static io .netty .util .internal .EmptyArrays .EMPTY_CERTIFICATES ;
6262import static io .netty .util .internal .EmptyArrays .EMPTY_JAVAX_X509_CERTIFICATES ;
6363import static io .netty .util .internal .ObjectUtil .checkNotNull ;
64+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_SSL_V2 ;
65+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_SSL_V2_HELLO ;
66+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_SSL_V3 ;
67+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_TLS_V1 ;
68+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_TLS_V1_1 ;
69+ import static io .netty .handler .ssl .SslUtils .PROTOCOL_TLS_V1_2 ;
6470import static java .lang .Integer .MAX_VALUE ;
6571import static java .lang .Math .min ;
6672import static javax .net .ssl .SSLEngineResult .HandshakeStatus .FINISHED ;
@@ -1341,7 +1347,7 @@ public final String[] getSupportedProtocols() {
13411347 public final String [] getEnabledProtocols () {
13421348 List <String > enabled = new ArrayList <String >(6 );
13431349 // Seems like there is no way to explicit disable SSLv2Hello in openssl so it is always enabled
1344- enabled .add (OpenSsl . PROTOCOL_SSL_V2_HELLO );
1350+ enabled .add (PROTOCOL_SSL_V2_HELLO );
13451351
13461352 int opts ;
13471353 synchronized (this ) {
@@ -1351,20 +1357,20 @@ public final String[] getEnabledProtocols() {
13511357 return enabled .toArray (new String [1 ]);
13521358 }
13531359 }
1354- if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1 , OpenSsl . PROTOCOL_TLS_V1 )) {
1355- enabled .add (OpenSsl . PROTOCOL_TLS_V1 );
1360+ if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1 , PROTOCOL_TLS_V1 )) {
1361+ enabled .add (PROTOCOL_TLS_V1 );
13561362 }
1357- if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1_1 , OpenSsl . PROTOCOL_TLS_V1_1 )) {
1358- enabled .add (OpenSsl . PROTOCOL_TLS_V1_1 );
1363+ if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1_1 , PROTOCOL_TLS_V1_1 )) {
1364+ enabled .add (PROTOCOL_TLS_V1_1 );
13591365 }
1360- if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1_2 , OpenSsl . PROTOCOL_TLS_V1_2 )) {
1361- enabled .add (OpenSsl . PROTOCOL_TLS_V1_2 );
1366+ if (isProtocolEnabled (opts , SSL .SSL_OP_NO_TLSv1_2 , PROTOCOL_TLS_V1_2 )) {
1367+ enabled .add (PROTOCOL_TLS_V1_2 );
13621368 }
1363- if (isProtocolEnabled (opts , SSL .SSL_OP_NO_SSLv2 , OpenSsl . PROTOCOL_SSL_V2 )) {
1364- enabled .add (OpenSsl . PROTOCOL_SSL_V2 );
1369+ if (isProtocolEnabled (opts , SSL .SSL_OP_NO_SSLv2 , PROTOCOL_SSL_V2 )) {
1370+ enabled .add (PROTOCOL_SSL_V2 );
13651371 }
1366- if (isProtocolEnabled (opts , SSL .SSL_OP_NO_SSLv3 , OpenSsl . PROTOCOL_SSL_V3 )) {
1367- enabled .add (OpenSsl . PROTOCOL_SSL_V3 );
1372+ if (isProtocolEnabled (opts , SSL .SSL_OP_NO_SSLv3 , PROTOCOL_SSL_V3 )) {
1373+ enabled .add (PROTOCOL_SSL_V3 );
13681374 }
13691375 return enabled .toArray (new String [enabled .size ()]);
13701376 }
@@ -1396,35 +1402,35 @@ public final void setEnabledProtocols(String[] protocols) {
13961402 if (!OpenSsl .SUPPORTED_PROTOCOLS_SET .contains (p )) {
13971403 throw new IllegalArgumentException ("Protocol " + p + " is not supported." );
13981404 }
1399- if (p .equals (OpenSsl . PROTOCOL_SSL_V2 )) {
1405+ if (p .equals (PROTOCOL_SSL_V2 )) {
14001406 if (minProtocolIndex > OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2 ) {
14011407 minProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2 ;
14021408 }
14031409 if (maxProtocolIndex < OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2 ) {
14041410 maxProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2 ;
14051411 }
1406- } else if (p .equals (OpenSsl . PROTOCOL_SSL_V3 )) {
1412+ } else if (p .equals (PROTOCOL_SSL_V3 )) {
14071413 if (minProtocolIndex > OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3 ) {
14081414 minProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3 ;
14091415 }
14101416 if (maxProtocolIndex < OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3 ) {
14111417 maxProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3 ;
14121418 }
1413- } else if (p .equals (OpenSsl . PROTOCOL_TLS_V1 )) {
1419+ } else if (p .equals (PROTOCOL_TLS_V1 )) {
14141420 if (minProtocolIndex > OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1 ) {
14151421 minProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1 ;
14161422 }
14171423 if (maxProtocolIndex < OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1 ) {
14181424 maxProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1 ;
14191425 }
1420- } else if (p .equals (OpenSsl . PROTOCOL_TLS_V1_1 )) {
1426+ } else if (p .equals (PROTOCOL_TLS_V1_1 )) {
14211427 if (minProtocolIndex > OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1 ) {
14221428 minProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1 ;
14231429 }
14241430 if (maxProtocolIndex < OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1 ) {
14251431 maxProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1 ;
14261432 }
1427- } else if (p .equals (OpenSsl . PROTOCOL_TLS_V1_2 )) {
1433+ } else if (p .equals (PROTOCOL_TLS_V1_2 )) {
14281434 if (minProtocolIndex > OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_2 ) {
14291435 minProtocolIndex = OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_2 ;
14301436 }
0 commit comments