gavinchou commented on code in PR #359:
URL: https://github.com/apache/doris-thirdparty/pull/359#discussion_r2382955686


##########
src/main/java/com/sleepycat/je/rep/utilint/net/SSLChannelFactory.java:
##########
@@ -263,7 +300,323 @@ public static boolean isValidHostVerifier(String hvSpec) {
     }
 
     /**
-     * Builds an SSLContext object for the specified access mode.
+     * Initialize certificate monitoring using scheduled executor for periodic 
checks.
+     */
+    private void initializeCertificateMonitoring() {
+        if (instanceParams == null) {
+            return;
+        }
+
+        try {
+            final ReplicationSSLConfig config =
+                (ReplicationSSLConfig) 
instanceParams.getContext().getRepNetConfig();
+
+            // Get the refresh interval from configuration
+            long refreshInterval = config.getSSLCertRefreshIntervalSeconds();
+
+            // If refresh interval is 0, disable certificate monitoring
+            if (refreshInterval <= 0) {
+                logger.log(INFO, "Certificate monitoring disabled (refresh 
interval = 0)");
+                return;
+            }
+
+            // Only monitor PEM configuration
+            final String pemCert = config.getSSLPemCertFile();
+            final String pemKey = config.getSSLPemKeyFile();
+            final String pemCa = config.getSSLPemCaCertFile();
+
+            // Create scheduled executor for periodic certificate checking
+            certificateCheckExecutor = 
Executors.newSingleThreadScheduledExecutor(r -> {

Review Comment:
   是因为要调用 `checkAndReloadCertificates` 所以不能全局用一个单例来监听文件变更吗?



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