Skip to content

Commit

Permalink
Update protocol for MemcachedCache (apache#16035)
Browse files Browse the repository at this point in the history
  • Loading branch information
pagrawal10 authored Mar 7, 2024
1 parent 564c44e commit bf39c71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static ConnectionFactory createConnectionFactory(final MemcachedCacheConf
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ public String getHosts()
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
Expand Down

0 comments on commit bf39c71

Please sign in to comment.