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


##########
server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:
##########
@@ -355,9 +364,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.usesslconnection()) {
+        // 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(config.autoDiscovery()) {
+        connectionFactoryBuilder.setClientMode(ClientMode.Dynamic);
+      }
+      else {
+        connectionFactoryBuilder.setClientMode(ClientMode.Static);
+      }

Review Comment:
   maybe we should call the config `clientMode` = `static` / `dynamic` here to 
better align with AWS naming rather than using our own



-- 
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