From dd2339bd38f781d9f74204ac3db24e773264ac7c Mon Sep 17 00:00:00 2001 From: yukon Date: Sun, 17 Dec 2017 20:22:24 +0800 Subject: [PATCH] Add log when reload the ssl context --- .../java/org/apache/rocketmq/broker/BrokerController.java | 5 +++-- .../java/org/apache/rocketmq/namesrv/NamesrvController.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java index 9a3a56af..8891bd32 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java @@ -406,6 +406,7 @@ public class BrokerController { @Override public void onChanged(String path) { if (path.equals(TlsSystemConfig.tlsServerTrustCertPath)) { + log.info("The trust certificate changed, reload the ssl context"); reloadServerSslContext(); } if (path.equals(TlsSystemConfig.tlsServerCertPath)) { @@ -415,8 +416,8 @@ public class BrokerController { keyChanged = true; } if (certChanged && keyChanged) { - certChanged = false; - keyChanged = false; + log.info("The certificate and private key changed, reload the ssl context"); + certChanged = keyChanged = false; reloadServerSslContext(); } } diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvController.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvController.java index 844175c3..2ed599c1 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvController.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvController.java @@ -113,6 +113,7 @@ public class NamesrvController { @Override public void onChanged(String path) { if (path.equals(TlsSystemConfig.tlsServerTrustCertPath)) { + log.info("The trust certificate changed, reload the ssl context"); reloadServerSslContext(); } if (path.equals(TlsSystemConfig.tlsServerCertPath)) { @@ -122,8 +123,8 @@ public class NamesrvController { keyChanged = true; } if (certChanged && keyChanged) { - certChanged = false; - keyChanged = false; + log.info("The certificate and private key changed, reload the ssl context"); + certChanged = keyChanged = false; reloadServerSslContext(); } } -- GitLab