@@ -620,8 +620,7 @@ private static SSLEngine dummySSLEngine(final String protocol) throws GeneralSec
620620 }
621621
622622 // should keep SSLContext as a member for introducin SSLSession. later...
623- final SSLEngine createSSLEngine (String peerHost , int peerPort )
624- throws NoSuchAlgorithmException , KeyManagementException {
623+ final SSLEngine createSSLEngine (String peerHost , int peerPort ) {
625624 final SSLEngine engine ;
626625 // an empty peerHost implies no SNI (RFC 3546) support requested
627626 if ( peerHost == null || peerHost .length () == 0 ) {
@@ -639,12 +638,9 @@ final SSLEngine createSSLEngine(String peerHost, int peerPort)
639638 }
640639
641640 private String [] getCipherSuites (final String [] supported ) {
642- Collection <CipherStrings .Def > cipherDefs =
643- CipherStrings .matchingCiphers (this .ciphers , supported , true );
641+ Collection <CipherStrings .Def > cipherDefs = CipherStrings .matchingCiphers (this .ciphers , supported , true );
644642 final String [] result = new String [ cipherDefs .size () ]; int i = 0 ;
645- for ( CipherStrings .Def def : cipherDefs ) {
646- result [ i ++ ] = def .getCipherSuite ();
647- }
643+ for ( CipherStrings .Def def : cipherDefs ) result [ i ++ ] = def .getCipherSuite ();
648644 return result ;
649645 }
650646
@@ -655,15 +651,12 @@ private String[] getEnabledProtocols(final SSLEngine engine) {
655651 final String [] engineProtocols = engine .getEnabledProtocols ();
656652 final List <String > protocols = new ArrayList <String >(enabledProtocols .length );
657653 for ( final String enabled : enabledProtocols ) {
658- if (((options & SSL .OP_NO_SSLv2 ) != 0 ) && enabled .equals ("SSLv2" )) {
659- continue ;
660- }
661- if (((options & SSL .OP_NO_SSLv3 ) != 0 ) && enabled .equals ("SSLv3" )) {
662- continue ;
663- }
664- if (((options & SSL .OP_NO_TLSv1 ) != 0 ) && enabled .equals ("TLSv1" )) {
665- continue ;
666- }
654+ if (((options & OP_NO_SSLv2 ) != 0 ) && enabled .equals ("SSLv2" )) continue ;
655+ if (((options & OP_NO_SSLv3 ) != 0 ) && enabled .equals ("SSLv3" )) continue ;
656+ if (((options & OP_NO_TLSv1 ) != 0 ) && enabled .equals ("TLSv1" )) continue ;
657+ if (((options & OP_NO_TLSv1_1 ) != 0 ) && enabled .equals ("TLSv1.1" )) continue ;
658+ if (((options & OP_NO_TLSv1_2 ) != 0 ) && enabled .equals ("TLSv1.2" )) continue ;
659+ if (((options & OP_NO_TLSv1_3 ) != 0 ) && enabled .equals ("TLSv1.3" )) continue ;
667660 for ( final String allowed : engineProtocols ) {
668661 if ( allowed .equals (enabled ) ) protocols .add (allowed );
669662 }
0 commit comments