25
25
26
26
package sun .security .ssl ;
27
27
28
- import java .io .* ;
28
+ import java .io .FileInputStream ;
29
29
import java .net .Socket ;
30
30
import java .security .*;
31
31
import java .security .cert .*;
@@ -617,26 +617,6 @@ SSLEngine createSSLEngineImpl(String host, int port) {
617
617
boolean isDTLS () {
618
618
return false ;
619
619
}
620
-
621
- static ProtocolVersion [] getSupportedProtocols () {
622
- if (SunJSSE .isFIPS ()) {
623
- return new ProtocolVersion [] {
624
- ProtocolVersion .TLS13 ,
625
- ProtocolVersion .TLS12 ,
626
- ProtocolVersion .TLS11 ,
627
- ProtocolVersion .TLS10
628
- };
629
- } else {
630
- return new ProtocolVersion []{
631
- ProtocolVersion .TLS13 ,
632
- ProtocolVersion .TLS12 ,
633
- ProtocolVersion .TLS11 ,
634
- ProtocolVersion .TLS10 ,
635
- ProtocolVersion .SSL30 ,
636
- ProtocolVersion .SSL20Hello
637
- };
638
- }
639
- }
640
620
}
641
621
642
622
/*
@@ -934,9 +914,41 @@ private static List<ProtocolVersion> customizedProtocols(
934
914
ProtocolVersion [] candidates ;
935
915
if (refactored .isEmpty ()) {
936
916
if (client ) {
937
- candidates = getProtocols ();
917
+ // default client protocols
918
+ if (SunJSSE .isFIPS ()) {
919
+ candidates = new ProtocolVersion [] {
920
+ ProtocolVersion .TLS13 ,
921
+ ProtocolVersion .TLS12 ,
922
+ ProtocolVersion .TLS11 ,
923
+ ProtocolVersion .TLS10
924
+ };
925
+ } else {
926
+ candidates = new ProtocolVersion [] {
927
+ ProtocolVersion .TLS13 ,
928
+ ProtocolVersion .TLS12 ,
929
+ ProtocolVersion .TLS11 ,
930
+ ProtocolVersion .TLS10 ,
931
+ ProtocolVersion .SSL30
932
+ };
933
+ }
938
934
} else {
939
- candidates = getSupportedProtocols ();
935
+ if (SunJSSE .isFIPS ()) {
936
+ candidates = new ProtocolVersion [] {
937
+ ProtocolVersion .TLS13 ,
938
+ ProtocolVersion .TLS12 ,
939
+ ProtocolVersion .TLS11 ,
940
+ ProtocolVersion .TLS10
941
+ };
942
+ } else {
943
+ candidates = new ProtocolVersion [] {
944
+ ProtocolVersion .TLS13 ,
945
+ ProtocolVersion .TLS12 ,
946
+ ProtocolVersion .TLS11 ,
947
+ ProtocolVersion .TLS10 ,
948
+ ProtocolVersion .SSL30 ,
949
+ ProtocolVersion .SSL20Hello
950
+ };
951
+ }
940
952
}
941
953
} else {
942
954
// Use the customized TLS protocols.
@@ -947,25 +959,6 @@ private static List<ProtocolVersion> customizedProtocols(
947
959
return getAvailableProtocols (candidates );
948
960
}
949
961
950
- static ProtocolVersion [] getProtocols () {
951
- if (SunJSSE .isFIPS ()) {
952
- return new ProtocolVersion []{
953
- ProtocolVersion .TLS13 ,
954
- ProtocolVersion .TLS12 ,
955
- ProtocolVersion .TLS11 ,
956
- ProtocolVersion .TLS10
957
- };
958
- } else {
959
- return new ProtocolVersion []{
960
- ProtocolVersion .TLS13 ,
961
- ProtocolVersion .TLS12 ,
962
- ProtocolVersion .TLS11 ,
963
- ProtocolVersion .TLS10 ,
964
- ProtocolVersion .SSL30
965
- };
966
- }
967
- }
968
-
969
962
protected CustomizedTLSContext () {
970
963
if (reservedException != null ) {
971
964
throw reservedException ;
@@ -991,8 +984,6 @@ List<CipherSuite> getClientDefaultCipherSuites() {
991
984
List <CipherSuite > getServerDefaultCipherSuites () {
992
985
return serverDefaultCipherSuites ;
993
986
}
994
-
995
-
996
987
}
997
988
998
989
/*
@@ -1243,7 +1234,6 @@ private abstract static class AbstractDTLSContext extends SSLContextImpl {
1243
1234
private static final List <CipherSuite > serverDefaultCipherSuites ;
1244
1235
1245
1236
static {
1246
- // Both DTLSv1.0 and DTLSv1.2 can be used in FIPS mode.
1247
1237
supportedProtocols = Arrays .asList (
1248
1238
ProtocolVersion .DTLS12 ,
1249
1239
ProtocolVersion .DTLS10
0 commit comments