pagrawal10 commented on code in PR #14827:
URL: https://github.com/apache/druid/pull/14827#discussion_r1314419203


##########
server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:
##########
@@ -355,9 +360,23 @@ public void updateHistogram(String name, int amount)
           .setReadBufferSize(config.getReadBufferSize())
           .setOpQueueFactory(opQueueFactory)
           .setMetricCollector(metricCollector)
-          .setEnableMetrics(MetricType.DEBUG) // Not as scary as it sounds
-          .build();
-
+          .setEnableMetrics(MetricType.DEBUG); // Not as scary as it sounds
+      if(config.enableTls()) {
+        // Build SSLContext
+        TrustManagerFactory tmf = 
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+        tmf.init((KeyStore) null);
+        SSLContext sslContext = SSLContext.getInstance("TLS");
+        sslContext.init(null, tmf.getTrustManagers(), null);
+        // Create the client in TLS mode
+        connectionFactoryBuilder.setSSLContext(sslContext);
+      }
+      if(Objects.equals(config.getClientMode(), "dynamic")) {
+        connectionFactoryBuilder.setClientMode(ClientMode.Dynamic);
+      }
+      else {
+        connectionFactoryBuilder.setClientMode(ClientMode.Static);

Review Comment:
   That change will not be backward compatible. As per my understanding, static 
mode mirrors the functionality present currently with spy.memcache. In case, 
the users do not provide any mode, we should default to static mode.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to