Skip to content

Commit e8146ac

Browse files
authored
Merge pull request docker-java#800 from orzeh/tls
Use TLSv2 by default
2 parents af8ff78 + 1c18337 commit e8146ac

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/com/github/dockerjava/core/LocalDirectorySSLConfig.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ public SSLContext getSSLContext() {
4545

4646
Security.addProvider(new BouncyCastleProvider());
4747

48-
// properties acrobatics not needed for java > 1.6
49-
String httpProtocols = System.getProperty("https.protocols");
50-
System.setProperty("https.protocols", "TLSv1");
51-
SslConfigurator sslConfig = SslConfigurator.newInstance(true);
52-
if (httpProtocols != null) {
53-
System.setProperty("https.protocols", httpProtocols);
54-
}
55-
5648
String caPemPath = dockerCertPath + File.separator + "ca.pem";
5749
String keyPemPath = dockerCertPath + File.separator + "key.pem";
5850
String certPemPath = dockerCertPath + File.separator + "cert.pem";
@@ -61,6 +53,8 @@ public SSLContext getSSLContext() {
6153
String certpem = new String(Files.readAllBytes(Paths.get(certPemPath)));
6254
String capem = new String(Files.readAllBytes(Paths.get(caPemPath)));
6355

56+
SslConfigurator sslConfig = SslConfigurator.newInstance(true);
57+
sslConfig.securityProtocol("TLSv1.2");
6458
sslConfig.keyStore(CertificateUtils.createKeyStore(keypem, certpem));
6559
sslConfig.keyStorePassword("docker");
6660
sslConfig.trustStore(CertificateUtils.createTrustStore(capem));

0 commit comments

Comments
 (0)