8235655: Clean the duplicated block in SSLContextImpl

Reviewed-by: coffeys
This commit is contained in:
Xue-Lei Andrew Fan 2019-12-10 09:31:40 -08:00
parent 11d4e9f34d
commit c185319515

@ -841,24 +841,13 @@ public abstract class SSLContextImpl extends SSLContextSpi {
// Use the default enabled protocols if no customization
ProtocolVersion[] candidates;
if (refactored.isEmpty()) {
if (client) {
// default client protocols
candidates = new ProtocolVersion[] {
ProtocolVersion.TLS13,
ProtocolVersion.TLS12,
ProtocolVersion.TLS11,
ProtocolVersion.TLS10
};
} else {
// default server protocols
candidates = new ProtocolVersion[] {
ProtocolVersion.TLS13,
ProtocolVersion.TLS12,
ProtocolVersion.TLS11,
ProtocolVersion.TLS10
// Client and server use the same default protocols.
candidates = new ProtocolVersion[] {
ProtocolVersion.TLS13,
ProtocolVersion.TLS12,
ProtocolVersion.TLS11,
ProtocolVersion.TLS10
};
}
} else {
// Use the customized TLS protocols.
candidates =