485714 - Update SSL configuration to mitigate SLOTH vulnerability
This commit is contained in:
parent
30308f2316
commit
0a1b0b2bc6
|
@ -27,6 +27,7 @@ import java.net.Socket;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLEngine;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
@ -36,6 +37,7 @@ import org.eclipse.jetty.server.Server;
|
||||||
import org.eclipse.jetty.server.ServerConnector;
|
import org.eclipse.jetty.server.ServerConnector;
|
||||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||||
|
import org.eclipse.jetty.util.TypeUtil;
|
||||||
import org.eclipse.jetty.util.resource.Resource;
|
import org.eclipse.jetty.util.resource.Resource;
|
||||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -59,7 +61,7 @@ public class SSLCloseTest
|
||||||
server.setHandler(new WriteHandler());
|
server.setHandler(new WriteHandler());
|
||||||
server.start();
|
server.start();
|
||||||
|
|
||||||
SSLContext ctx=SSLContext.getInstance("SSLv3");
|
SSLContext ctx=SSLContext.getInstance("TLSv1.2");
|
||||||
ctx.init(null,SslContextFactory.TRUST_ALL_CERTS,new java.security.SecureRandom());
|
ctx.init(null,SslContextFactory.TRUST_ALL_CERTS,new java.security.SecureRandom());
|
||||||
|
|
||||||
int port=connector.getLocalPort();
|
int port=connector.getLocalPort();
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class SSLEngineTest
|
||||||
|
|
||||||
Socket[] client=new Socket[numConns];
|
Socket[] client=new Socket[numConns];
|
||||||
|
|
||||||
SSLContext ctx=SSLContext.getInstance("SSLv3");
|
SSLContext ctx=SSLContext.getInstance("TLSv1.2");
|
||||||
ctx.init(null,SslContextFactory.TRUST_ALL_CERTS,new java.security.SecureRandom());
|
ctx.init(null,SslContextFactory.TRUST_ALL_CERTS,new java.security.SecureRandom());
|
||||||
|
|
||||||
int port=connector.getLocalPort();
|
int port=connector.getLocalPort();
|
||||||
|
|
|
@ -250,14 +250,10 @@ public class SslContextFactory extends AbstractLifeCycle
|
||||||
setTrustAll(trustAll);
|
setTrustAll(trustAll);
|
||||||
addExcludeProtocols("SSL", "SSLv2", "SSLv2Hello", "SSLv3");
|
addExcludeProtocols("SSL", "SSLv2", "SSLv2Hello", "SSLv3");
|
||||||
setExcludeCipherSuites(
|
setExcludeCipherSuites(
|
||||||
"SSL_RSA_WITH_DES_CBC_SHA",
|
"^.*_RSA_.*_(MD5|SHA|SHA1)$",
|
||||||
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
|
||||||
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||||
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
|
||||||
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
|
||||||
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
|
||||||
"SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
|
"SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an instance of SslContextFactory
|
* Construct an instance of SslContextFactory
|
||||||
|
|
|
@ -29,6 +29,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import javax.net.ssl.SSLEngine;
|
import javax.net.ssl.SSLEngine;
|
||||||
|
|
||||||
|
@ -56,6 +57,20 @@ public class SslContextFactoryTest
|
||||||
cf = new SslContextFactory();
|
cf = new SslContextFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSLOTH() throws Exception
|
||||||
|
{
|
||||||
|
cf.setKeyStorePassword("storepwd");
|
||||||
|
cf.setKeyManagerPassword("keypwd");
|
||||||
|
|
||||||
|
cf.start();
|
||||||
|
|
||||||
|
System.err.println(Arrays.asList(cf.getSelectedProtocols()));
|
||||||
|
for (String cipher : cf.getSelectedCipherSuites())
|
||||||
|
System.err.println(cipher);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoTsFileKs() throws Exception
|
public void testNoTsFileKs() throws Exception
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue