Skip to content

Use TLSv1.2 by default #800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ public SSLContext getSSLContext() {

Security.addProvider(new BouncyCastleProvider());

// properties acrobatics not needed for java > 1.6
String httpProtocols = System.getProperty("https.protocols");
System.setProperty("https.protocols", "TLSv1");
SslConfigurator sslConfig = SslConfigurator.newInstance(true);
if (httpProtocols != null) {
System.setProperty("https.protocols", httpProtocols);
}

String caPemPath = dockerCertPath + File.separator + "ca.pem";
String keyPemPath = dockerCertPath + File.separator + "key.pem";
String certPemPath = dockerCertPath + File.separator + "cert.pem";
Expand All @@ -61,6 +53,8 @@ public SSLContext getSSLContext() {
String certpem = new String(Files.readAllBytes(Paths.get(certPemPath)));
String capem = new String(Files.readAllBytes(Paths.get(caPemPath)));

SslConfigurator sslConfig = SslConfigurator.newInstance(true);
sslConfig.securityProtocol("TLSv1.2");
sslConfig.keyStore(CertificateUtils.createKeyStore(keypem, certpem));
sslConfig.keyStorePassword("docker");
sslConfig.trustStore(CertificateUtils.createTrustStore(capem));
Expand Down