diff --git a/server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java b/server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java index d67e01b110b..d5849fad99e 100644 --- a/server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java +++ b/server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java @@ -413,7 +413,7 @@ public class MemcachedCache implements Cache // Build SSLContext TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init((KeyStore) null); - SSLContext sslContext = SSLContext.getInstance("TLS"); + SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, tmf.getTrustManagers(), null); // Create the client in TLS mode connectionFactoryBuilder.setSSLContext(sslContext); diff --git a/server/src/test/java/org/apache/druid/client/cache/MemcachedCacheTest.java b/server/src/test/java/org/apache/druid/client/cache/MemcachedCacheTest.java index ceb3a828772..d7748c7e48f 100644 --- a/server/src/test/java/org/apache/druid/client/cache/MemcachedCacheTest.java +++ b/server/src/test/java/org/apache/druid/client/cache/MemcachedCacheTest.java @@ -254,6 +254,8 @@ public class MemcachedCacheTest Assert.assertEquals(connectionFactoryDynamic.getClientMode(), ClientMode.Dynamic); //enableTls is true so sslContext is not null Assert.assertNotNull(connectionFactoryDynamic.getSSLContext()); + // Ensure Protocol is TLSv1.2 + Assert.assertEquals("TLSv1.2", connectionFactoryDynamic.getSSLContext().getProtocol()); } @Test