Fixes #870 - TLS protocol exclusion broken for SslContextFactory(String).

Introduced a private constructor that performs the correct
initialization, and have the other constructors delegate to it.
This commit is contained in:
Simone Bordet 2016-09-15 12:10:52 +02:00
parent 9e01565344
commit 01e29aa45a
1 changed files with 11 additions and 4 deletions

View File

@ -241,9 +241,7 @@ public class SslContextFactory extends AbstractLifeCycle
*/
public SslContextFactory(boolean trustAll)
{
setTrustAll(trustAll);
addExcludeProtocols("SSL", "SSLv2", "SSLv2Hello", "SSLv3");
setExcludeCipherSuites("^.*_(MD5|SHA|SHA1)$");
this(trustAll, null);
}
/**
@ -252,7 +250,16 @@ public class SslContextFactory extends AbstractLifeCycle
*/
public SslContextFactory(String keyStorePath)
{
setKeyStorePath(keyStorePath);
this(false, keyStorePath);
}
private SslContextFactory(boolean trustAll, String keyStorePath)
{
setTrustAll(trustAll);
addExcludeProtocols("SSL", "SSLv2", "SSLv2Hello", "SSLv3");
setExcludeCipherSuites("^.*_(MD5|SHA|SHA1)$");
if (keyStorePath != null)
setKeyStorePath(keyStorePath);
}
public String[] getSelectedProtocols()