diff options
author | Francis Dupont <fdupont@isc.org> | 2024-11-29 11:34:37 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2024-11-29 11:34:37 +0100 |
commit | e138afba296189fa3614638fc55d6418b26dcefa (patch) | |
tree | 86dac764d6669b12f0a820317249a558c347cba0 | |
parent | [#3255] Added a getTlsContext to HTTP listener (diff) | |
download | kea-e138afba296189fa3614638fc55d6418b26dcefa.tar.xz kea-e138afba296189fa3614638fc55d6418b26dcefa.zip |
[#3255] Added CA reuse logs
-rw-r--r-- | src/bin/agent/ca_messages.cc | 4 | ||||
-rw-r--r-- | src/bin/agent/ca_messages.h | 2 | ||||
-rw-r--r-- | src/bin/agent/ca_messages.mes | 9 | ||||
-rw-r--r-- | src/bin/agent/ca_process.cc | 18 |
4 files changed, 31 insertions, 2 deletions
diff --git a/src/bin/agent/ca_messages.cc b/src/bin/agent/ca_messages.cc index 4c9df2bb8d..7c511012bd 100644 --- a/src/bin/agent/ca_messages.cc +++ b/src/bin/agent/ca_messages.cc @@ -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", diff --git a/src/bin/agent/ca_messages.h b/src/bin/agent/ca_messages.h index dda48661fc..59ad772807 100644 --- a/src/bin/agent/ca_messages.h +++ b/src/bin/agent/ca_messages.h @@ -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; diff --git a/src/bin/agent/ca_messages.mes b/src/bin/agent/ca_messages.mes index 70df329bd1..f592955f3d 100644 --- a/src/bin/agent/ca_messages.mes +++ b/src/bin/agent/ca_messages.mes @@ -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 diff --git a/src/bin/agent/ca_process.cc b/src/bin/agent/ca_process.cc index 2403eedb1a..86dec95e36 100644 --- a/src/bin/agent/ca_process.cc +++ b/src/bin/agent/ca_process.cc @@ -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); } }); |