mirror of https://github.com/apache/druid.git
Update protocol for MemcachedCache (#16035)
This commit is contained in:
parent
564c44ed85
commit
bf39c71d2a
|
@ -413,7 +413,7 @@ public class MemcachedCache implements Cache
|
||||||
// Build SSLContext
|
// Build SSLContext
|
||||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||||
tmf.init((KeyStore) null);
|
tmf.init((KeyStore) null);
|
||||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
|
||||||
sslContext.init(null, tmf.getTrustManagers(), null);
|
sslContext.init(null, tmf.getTrustManagers(), null);
|
||||||
// Create the client in TLS mode
|
// Create the client in TLS mode
|
||||||
connectionFactoryBuilder.setSSLContext(sslContext);
|
connectionFactoryBuilder.setSSLContext(sslContext);
|
||||||
|
|
|
@ -254,6 +254,8 @@ public class MemcachedCacheTest
|
||||||
Assert.assertEquals(connectionFactoryDynamic.getClientMode(), ClientMode.Dynamic);
|
Assert.assertEquals(connectionFactoryDynamic.getClientMode(), ClientMode.Dynamic);
|
||||||
//enableTls is true so sslContext is not null
|
//enableTls is true so sslContext is not null
|
||||||
Assert.assertNotNull(connectionFactoryDynamic.getSSLContext());
|
Assert.assertNotNull(connectionFactoryDynamic.getSSLContext());
|
||||||
|
// Ensure Protocol is TLSv1.2
|
||||||
|
Assert.assertEquals("TLSv1.2", connectionFactoryDynamic.getSSLContext().getProtocol());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue