]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3255] Added CA reuse logs
authorFrancis Dupont <fdupont@isc.org>
Fri, 29 Nov 2024 10:34:37 +0000 (11:34 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 29 Nov 2024 10:34:37 +0000 (11:34 +0100)
src/bin/agent/ca_messages.cc
src/bin/agent/ca_messages.h
src/bin/agent/ca_messages.mes
src/bin/agent/ca_process.cc

index 4c9df2bb8d2ede044544792d705f02dd8fac3777..7c511012bd3ef316b846bf5fe1a86543ba615010 100644 (file)
@@ -15,7 +15,9 @@ extern const isc::log::MessageID CTRL_AGENT_CONFIG_CHECK_FAIL = "CTRL_AGENT_CONF
 extern const isc::log::MessageID CTRL_AGENT_CONFIG_FAIL = "CTRL_AGENT_CONFIG_FAIL";
 extern const isc::log::MessageID CTRL_AGENT_CONFIG_SYNTAX_WARNING = "CTRL_AGENT_CONFIG_SYNTAX_WARNING";
 extern const isc::log::MessageID CTRL_AGENT_FAILED = "CTRL_AGENT_FAILED";
+extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_REUSED = "CTRL_AGENT_HTTPS_SERVICE_REUSED";
 extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_STARTED = "CTRL_AGENT_HTTPS_SERVICE_STARTED";
+extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_REUSED = "CTRL_AGENT_HTTP_SERVICE_REUSED";
 extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_STARTED = "CTRL_AGENT_HTTP_SERVICE_STARTED";
 extern const isc::log::MessageID CTRL_AGENT_RUN_EXIT = "CTRL_AGENT_RUN_EXIT";
 extern const isc::log::MessageID CTRL_AGENT_STARTED = "CTRL_AGENT_STARTED";
@@ -34,7 +36,9 @@ const char* values[] = {
     "CTRL_AGENT_CONFIG_FAIL", "Control Agent configuration failed: %1",
     "CTRL_AGENT_CONFIG_SYNTAX_WARNING", "Control Agent configuration syntax warning: %1",
     "CTRL_AGENT_FAILED", "application experienced a fatal error: %1",
+    "CTRL_AGENT_HTTPS_SERVICE_REUSED", "reused HTTPS service bound to address %1:%2",
     "CTRL_AGENT_HTTPS_SERVICE_STARTED", "HTTPS service bound to address %1:%2",
+    "CTRL_AGENT_HTTP_SERVICE_REUSED", "reused HTTP service bound to address %1:%2",
     "CTRL_AGENT_HTTP_SERVICE_STARTED", "HTTP service bound to address %1:%2",
     "CTRL_AGENT_RUN_EXIT", "application is exiting the event loop",
     "CTRL_AGENT_STARTED", "Kea Control Agent version %1 started",
index dda48661fc7225ef18a90fe3a5d272c8aafc98f7..59ad7728076df438340b7da5eefa60ec862d366c 100644 (file)
@@ -16,7 +16,9 @@ extern const isc::log::MessageID CTRL_AGENT_CONFIG_CHECK_FAIL;
 extern const isc::log::MessageID CTRL_AGENT_CONFIG_FAIL;
 extern const isc::log::MessageID CTRL_AGENT_CONFIG_SYNTAX_WARNING;
 extern const isc::log::MessageID CTRL_AGENT_FAILED;
+extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_REUSED;
 extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_STARTED;
+extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_REUSED;
 extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_STARTED;
 extern const isc::log::MessageID CTRL_AGENT_RUN_EXIT;
 extern const isc::log::MessageID CTRL_AGENT_STARTED;
index 70df329bd19a1f8117f3d83aa91e1102f1bd6f15..f592955f3dd2a5a2e1bbf3f8986c3f15a1e2e344 100644 (file)
@@ -43,11 +43,20 @@ error. The error was displayed and the configuration parsing resumed.
 This is a fatal error message issued when the Control Agent application
 encounters an unrecoverable error from within the event loop.
 
+% CTRL_AGENT_HTTPS_SERVICE_REUSED reused HTTPS service bound to address %1:%2
+This informational message indicates that the server has reused existing
+HTTPS service on the specified address and port. Note that any change in
+the TLS setup was ignored.
+
 % CTRL_AGENT_HTTPS_SERVICE_STARTED HTTPS service bound to address %1:%2
 This informational message indicates that the server has started HTTPS service
 on the specified address and port. All control commands should be sent to this
 address and port over a TLS channel.
 
+% CTRL_AGENT_HTTP_SERVICE_REUSED reused HTTP service bound to address %1:%2
+This informational message indicates that the server has reused existing
+HTTPS service on the specified address and port.
+
 % CTRL_AGENT_HTTP_SERVICE_STARTED HTTP service bound to address %1:%2
 This informational message indicates that the server has started HTTP service
 on the specified address and port. All control commands should be sent to this
index 2403eedb1a64d93edbad9dc68455a4d088e99011..86dec95e3603ab5fe9317fd8e50a7d6c61d1e654 100644 (file)
@@ -181,15 +181,29 @@ CtrlAgentProcess::configure(isc::data::ConstElementPtr config_set,
             // active listeners. The next step will be to remove all other
             // active listeners, but we do it inside the main process loop.
             http_listeners_.push_back(http_listener);
+        } else if (!http_listeners_.empty()) {
+            // Reconfig keeping the same address and port.
+            if (http_listeners_.back()->getTlsContext()) {
+                LOG_INFO(agent_logger, CTRL_AGENT_HTTPS_SERVICE_REUSED)
+                    .arg(server_address.toText())
+                    .arg(server_port);
+            } else {
+                LOG_INFO(agent_logger, CTRL_AGENT_HTTP_SERVICE_REUSED)
+                    .arg(server_address.toText())
+                    .arg(server_port);
+            }
+            return;
         }
 
         // Ok, seems we're good to go.
         if (use_https) {
           LOG_INFO(agent_logger, CTRL_AGENT_HTTPS_SERVICE_STARTED)
-              .arg(server_address.toText()).arg(server_port);
+              .arg(server_address.toText())
+              .arg(server_port);
         } else {
             LOG_INFO(agent_logger, CTRL_AGENT_HTTP_SERVICE_STARTED)
-                .arg(server_address.toText()).arg(server_port);
+                .arg(server_address.toText())
+                .arg(server_port);
         }
     });