mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8235448: code cleanup in SSLContextImpl.java
Reviewed-by: jnimeh
This commit is contained in:
parent
45b8d09e1b
commit
baebce3d2f
1 changed files with 20 additions and 28 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
package sun.security.ssl;
|
package sun.security.ssl;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.FileInputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.security.*;
|
import java.security.*;
|
||||||
import java.security.cert.*;
|
import java.security.cert.*;
|
||||||
|
@ -71,7 +71,8 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
private volatile StatusResponseManager statusResponseManager;
|
private volatile StatusResponseManager statusResponseManager;
|
||||||
|
|
||||||
private final ReentrantLock contextLock = new ReentrantLock();
|
private final ReentrantLock contextLock = new ReentrantLock();
|
||||||
final HashMap<Integer, SessionTicketExtension.StatelessKey> keyHashMap = new HashMap<>();
|
final HashMap<Integer,
|
||||||
|
SessionTicketExtension.StatelessKey> keyHashMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
SSLContextImpl() {
|
SSLContextImpl() {
|
||||||
|
@ -594,17 +595,6 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
boolean isDTLS() {
|
boolean isDTLS() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ProtocolVersion[] getSupportedProtocols() {
|
|
||||||
return new ProtocolVersion[]{
|
|
||||||
ProtocolVersion.TLS13,
|
|
||||||
ProtocolVersion.TLS12,
|
|
||||||
ProtocolVersion.TLS11,
|
|
||||||
ProtocolVersion.TLS10,
|
|
||||||
ProtocolVersion.SSL30,
|
|
||||||
ProtocolVersion.SSL20Hello
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -858,9 +848,24 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
ProtocolVersion[] candidates;
|
ProtocolVersion[] candidates;
|
||||||
if (refactored.isEmpty()) {
|
if (refactored.isEmpty()) {
|
||||||
if (client) {
|
if (client) {
|
||||||
candidates = getProtocols();
|
// default client protocols
|
||||||
|
candidates = new ProtocolVersion[] {
|
||||||
|
ProtocolVersion.TLS13,
|
||||||
|
ProtocolVersion.TLS12,
|
||||||
|
ProtocolVersion.TLS11,
|
||||||
|
ProtocolVersion.TLS10,
|
||||||
|
ProtocolVersion.SSL30
|
||||||
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
candidates = getSupportedProtocols();
|
candidates = new ProtocolVersion[] {
|
||||||
|
ProtocolVersion.TLS13,
|
||||||
|
ProtocolVersion.TLS12,
|
||||||
|
ProtocolVersion.TLS11,
|
||||||
|
ProtocolVersion.TLS10,
|
||||||
|
ProtocolVersion.SSL30,
|
||||||
|
ProtocolVersion.SSL20Hello
|
||||||
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Use the customized TLS protocols.
|
// Use the customized TLS protocols.
|
||||||
|
@ -871,16 +876,6 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
return getAvailableProtocols(candidates);
|
return getAvailableProtocols(candidates);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ProtocolVersion[] getProtocols() {
|
|
||||||
return new ProtocolVersion[]{
|
|
||||||
ProtocolVersion.TLS13,
|
|
||||||
ProtocolVersion.TLS12,
|
|
||||||
ProtocolVersion.TLS11,
|
|
||||||
ProtocolVersion.TLS10,
|
|
||||||
ProtocolVersion.SSL30
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected CustomizedTLSContext() {
|
protected CustomizedTLSContext() {
|
||||||
if (reservedException != null) {
|
if (reservedException != null) {
|
||||||
throw reservedException;
|
throw reservedException;
|
||||||
|
@ -906,8 +901,6 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
List<CipherSuite> getServerDefaultCipherSuites() {
|
List<CipherSuite> getServerDefaultCipherSuites() {
|
||||||
return serverDefaultCipherSuites;
|
return serverDefaultCipherSuites;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1183,7 +1176,6 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
||||||
private static final List<CipherSuite> serverDefaultCipherSuites;
|
private static final List<CipherSuite> serverDefaultCipherSuites;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Both DTLSv1.0 and DTLSv1.2 can be used in FIPS mode.
|
|
||||||
supportedProtocols = Arrays.asList(
|
supportedProtocols = Arrays.asList(
|
||||||
ProtocolVersion.DTLS12,
|
ProtocolVersion.DTLS12,
|
||||||
ProtocolVersion.DTLS10
|
ProtocolVersion.DTLS10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue