2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00

[#3734] Remove unnecessary HAVE_PGSQL_SSL macro

This commit is contained in:
Andrei Pavel 2025-05-13 22:32:11 +03:00
parent d541ff3f7b
commit c46442bc16
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
20 changed files with 3 additions and 147 deletions

View File

@ -40,9 +40,6 @@
/* PostgreSQL is present */ /* PostgreSQL is present */
#mesondefine HAVE_PGSQL #mesondefine HAVE_PGSQL
/* PostgreSQL was built with OpenSSL support */
#mesondefine HAVE_PGSQL_SSL
/* PostgreSQL connection parameter tcp_user_timeout supported */ /* PostgreSQL connection parameter tcp_user_timeout supported */
#mesondefine HAVE_PGSQL_TCP_USER_TIMEOUT #mesondefine HAVE_PGSQL_TCP_USER_TIMEOUT

View File

@ -124,7 +124,6 @@ KEA_MSG_COMPILER = disabler()
#### Configuration Data #### Configuration Data
# TODO: Remaining define macros used in code, but not handled by meson: # TODO: Remaining define macros used in code, but not handled by meson:
# - HAVE_PGSQL_SSL
# - USE_STATIC_LINK # - USE_STATIC_LINK
conf_data = configuration_data( conf_data = configuration_data(

View File

@ -88,21 +88,6 @@ PgSqlConfigBackendImpl::PgSqlConfigBackendImpl(const std::string& space,
tls += parameters.count("cert-file"); tls += parameters.count("cert-file");
tls += parameters.count("key-file"); tls += parameters.count("key-file");
tls += parameters.count("cipher-list"); tls += parameters.count("cipher-list");
#ifdef HAVE_PGSQL_SSL
if ((tls > 0) && !PgSqlConnection::warned_about_tls) {
PgSqlConnection::warned_about_tls = true;
LOG_INFO(pgsql_cb_logger, PGSQL_CB_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters);
PQinitSSL(1);
}
#else
if (tls > 0) {
LOG_ERROR(pgsql_cb_logger, PGSQL_CB_NO_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters));
isc_throw(DbOpenError, "Attempt to configure TLS for PostgreSQL "
<< "backend (built with this feature disabled)");
}
#endif
// Create unique timer name per instance. // Create unique timer name per instance.
timer_name_ = "PgSqlConfigBackend"; timer_name_ = "PgSqlConfigBackend";
@ -1170,7 +1155,7 @@ PgSqlConfigBackendImpl::addOptionValueBinding(PsqlBindArray& bindings,
} }
} }
void void
PgSqlConfigBackendImpl::addClientClassesBinding(db::PsqlBindArray& bindings, PgSqlConfigBackendImpl::addClientClassesBinding(db::PsqlBindArray& bindings,
const ClientClasses& client_classes) { const ClientClasses& client_classes) {
// Create JSON list of client classes. // Create JSON list of client classes.

View File

@ -184,7 +184,6 @@ extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_PREFIX = "PGSQL_CB_GET_
extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID = "PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID"; extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID = "PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID";
extern const isc::log::MessageID PGSQL_CB_GET_TYPE4 = "PGSQL_CB_GET_TYPE4"; extern const isc::log::MessageID PGSQL_CB_GET_TYPE4 = "PGSQL_CB_GET_TYPE4";
extern const isc::log::MessageID PGSQL_CB_GET_TYPE6 = "PGSQL_CB_GET_TYPE6"; extern const isc::log::MessageID PGSQL_CB_GET_TYPE6 = "PGSQL_CB_GET_TYPE6";
extern const isc::log::MessageID PGSQL_CB_NO_TLS_SUPPORT = "PGSQL_CB_NO_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED4 = "PGSQL_CB_RECONNECT_ATTEMPT_FAILED4"; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED4 = "PGSQL_CB_RECONNECT_ATTEMPT_FAILED4";
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED6 = "PGSQL_CB_RECONNECT_ATTEMPT_FAILED6"; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED6 = "PGSQL_CB_RECONNECT_ATTEMPT_FAILED6";
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4 = "PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4"; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4 = "PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4";
@ -193,7 +192,6 @@ extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED4 = "PGSQL_CB_RECONNEC
extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED6 = "PGSQL_CB_RECONNECT_FAILED6"; extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED6 = "PGSQL_CB_RECONNECT_FAILED6";
extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE4 = "PGSQL_CB_REGISTER_BACKEND_TYPE4"; extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE4 = "PGSQL_CB_REGISTER_BACKEND_TYPE4";
extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE6 = "PGSQL_CB_REGISTER_BACKEND_TYPE6"; extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE6 = "PGSQL_CB_REGISTER_BACKEND_TYPE6";
extern const isc::log::MessageID PGSQL_CB_TLS_SUPPORT = "PGSQL_CB_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE4 = "PGSQL_CB_UNREGISTER_BACKEND_TYPE4"; extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE4 = "PGSQL_CB_UNREGISTER_BACKEND_TYPE4";
extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE6 = "PGSQL_CB_UNREGISTER_BACKEND_TYPE6"; extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE6 = "PGSQL_CB_UNREGISTER_BACKEND_TYPE6";
@ -380,7 +378,6 @@ const char* values[] = {
"PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID", "retrieving subnet by subnet id: %1", "PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID", "retrieving subnet by subnet id: %1",
"PGSQL_CB_GET_TYPE4", "get type", "PGSQL_CB_GET_TYPE4", "get type",
"PGSQL_CB_GET_TYPE6", "get type", "PGSQL_CB_GET_TYPE6", "get type",
"PGSQL_CB_NO_TLS_SUPPORT", "Attempt to configure TLS (unsupported for PostgreSQL): %1",
"PGSQL_CB_RECONNECT_ATTEMPT_FAILED4", "database reconnect failed: %1", "PGSQL_CB_RECONNECT_ATTEMPT_FAILED4", "database reconnect failed: %1",
"PGSQL_CB_RECONNECT_ATTEMPT_FAILED6", "database reconnect failed: %1", "PGSQL_CB_RECONNECT_ATTEMPT_FAILED6", "database reconnect failed: %1",
"PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4", "scheduling attempt %1 of %2 in %3 milliseconds", "PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4", "scheduling attempt %1 of %2 in %3 milliseconds",
@ -389,7 +386,6 @@ const char* values[] = {
"PGSQL_CB_RECONNECT_FAILED6", "maximum number of database reconnect attempts: %1, has been exhausted without success", "PGSQL_CB_RECONNECT_FAILED6", "maximum number of database reconnect attempts: %1, has been exhausted without success",
"PGSQL_CB_REGISTER_BACKEND_TYPE4", "register backend", "PGSQL_CB_REGISTER_BACKEND_TYPE4", "register backend",
"PGSQL_CB_REGISTER_BACKEND_TYPE6", "register backend", "PGSQL_CB_REGISTER_BACKEND_TYPE6", "register backend",
"PGSQL_CB_TLS_SUPPORT", "Attempt to configure TLS: %1",
"PGSQL_CB_UNREGISTER_BACKEND_TYPE4", "unregister backend", "PGSQL_CB_UNREGISTER_BACKEND_TYPE4", "unregister backend",
"PGSQL_CB_UNREGISTER_BACKEND_TYPE6", "unregister backend", "PGSQL_CB_UNREGISTER_BACKEND_TYPE6", "unregister backend",
NULL NULL

View File

@ -185,7 +185,6 @@ extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_PREFIX;
extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID; extern const isc::log::MessageID PGSQL_CB_GET_SUBNET6_BY_SUBNET_ID;
extern const isc::log::MessageID PGSQL_CB_GET_TYPE4; extern const isc::log::MessageID PGSQL_CB_GET_TYPE4;
extern const isc::log::MessageID PGSQL_CB_GET_TYPE6; extern const isc::log::MessageID PGSQL_CB_GET_TYPE6;
extern const isc::log::MessageID PGSQL_CB_NO_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED4; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED4;
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED6; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_FAILED6;
extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4; extern const isc::log::MessageID PGSQL_CB_RECONNECT_ATTEMPT_SCHEDULE4;
@ -194,7 +193,6 @@ extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED4;
extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED6; extern const isc::log::MessageID PGSQL_CB_RECONNECT_FAILED6;
extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE4; extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE4;
extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE6; extern const isc::log::MessageID PGSQL_CB_REGISTER_BACKEND_TYPE6;
extern const isc::log::MessageID PGSQL_CB_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE4; extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE4;
extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE6; extern const isc::log::MessageID PGSQL_CB_UNREGISTER_BACKEND_TYPE6;

View File

@ -720,11 +720,6 @@ Debug message issued when triggered an action to retrieve type
Logged at debug log level 40. Logged at debug log level 40.
Debug message issued when triggered an action to retrieve type Debug message issued when triggered an action to retrieve type
% PGSQL_CB_NO_TLS_SUPPORT Attempt to configure TLS (unsupported for PostgreSQL): %1
This error message is printed when TLS support was required in the Kea
configuration: Kea was built with this feature disabled for PostgreSQL.
The parameters of the connection are logged.
% PGSQL_CB_RECONNECT_ATTEMPT_FAILED4 database reconnect failed: %1 % PGSQL_CB_RECONNECT_ATTEMPT_FAILED4 database reconnect failed: %1
Error message issued when an attempt to reconnect has failed. Error message issued when an attempt to reconnect has failed.
@ -757,12 +752,6 @@ Debug message issued when triggered an action to register backend
Logged at debug log level 40. Logged at debug log level 40.
Debug message issued when triggered an action to register backend Debug message issued when triggered an action to register backend
% PGSQL_CB_TLS_SUPPORT Attempt to configure TLS: %1
This informational message is printed when TLS support was required in
the Kea configuration: The TLS support in PostgreSQL will be initialized but
its configuration is fully managed outside the C API.
The parameters of the connection are logged.
% PGSQL_CB_UNREGISTER_BACKEND_TYPE4 unregister backend % PGSQL_CB_UNREGISTER_BACKEND_TYPE4 unregister backend
Logged at debug log level 40. Logged at debug log level 40.
Debug message issued when triggered an action to unregister backend Debug message issued when triggered an action to unregister backend

View File

@ -16,10 +16,8 @@ extern const isc::log::MessageID LEGAL_LOG_PGSQL_FATAL_ERROR = "LEGAL_LOG_PGSQL_
extern const isc::log::MessageID LEGAL_LOG_PGSQL_GET_VERSION = "LEGAL_LOG_PGSQL_GET_VERSION"; extern const isc::log::MessageID LEGAL_LOG_PGSQL_GET_VERSION = "LEGAL_LOG_PGSQL_GET_VERSION";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_INSERT_LOG = "LEGAL_LOG_PGSQL_INSERT_LOG"; extern const isc::log::MessageID LEGAL_LOG_PGSQL_INSERT_LOG = "LEGAL_LOG_PGSQL_INSERT_LOG";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_INVALID_ACCESS = "LEGAL_LOG_PGSQL_INVALID_ACCESS"; extern const isc::log::MessageID LEGAL_LOG_PGSQL_INVALID_ACCESS = "LEGAL_LOG_PGSQL_INVALID_ACCESS";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_NO_TLS_SUPPORT = "LEGAL_LOG_PGSQL_NO_TLS_SUPPORT";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_ROLLBACK = "LEGAL_LOG_PGSQL_ROLLBACK"; extern const isc::log::MessageID LEGAL_LOG_PGSQL_ROLLBACK = "LEGAL_LOG_PGSQL_ROLLBACK";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_START_TRANSACTION = "LEGAL_LOG_PGSQL_START_TRANSACTION"; extern const isc::log::MessageID LEGAL_LOG_PGSQL_START_TRANSACTION = "LEGAL_LOG_PGSQL_START_TRANSACTION";
extern const isc::log::MessageID LEGAL_LOG_PGSQL_TLS_SUPPORT = "LEGAL_LOG_PGSQL_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_FB_DB = "PGSQL_FB_DB"; extern const isc::log::MessageID PGSQL_FB_DB = "PGSQL_FB_DB";
} // namespace dhcp } // namespace dhcp
@ -37,10 +35,8 @@ const char* values[] = {
"LEGAL_LOG_PGSQL_GET_VERSION", "obtaining schema version information", "LEGAL_LOG_PGSQL_GET_VERSION", "obtaining schema version information",
"LEGAL_LOG_PGSQL_INSERT_LOG", "Adding a log entry to the database: %1", "LEGAL_LOG_PGSQL_INSERT_LOG", "Adding a log entry to the database: %1",
"LEGAL_LOG_PGSQL_INVALID_ACCESS", "invalid database access string: %1", "LEGAL_LOG_PGSQL_INVALID_ACCESS", "invalid database access string: %1",
"LEGAL_LOG_PGSQL_NO_TLS_SUPPORT", "Attempt to configure TLS (unsupported for PostgreSQL): %1",
"LEGAL_LOG_PGSQL_ROLLBACK", "rolling back PostgreSQL database", "LEGAL_LOG_PGSQL_ROLLBACK", "rolling back PostgreSQL database",
"LEGAL_LOG_PGSQL_START_TRANSACTION", "starting a new PostgreSQL transaction", "LEGAL_LOG_PGSQL_START_TRANSACTION", "starting a new PostgreSQL transaction",
"LEGAL_LOG_PGSQL_TLS_SUPPORT", "Attempt to configure TLS: %1",
"PGSQL_FB_DB", "opening PostgreSQL log database: %1", "PGSQL_FB_DB", "opening PostgreSQL log database: %1",
NULL NULL
}; };

View File

@ -17,10 +17,8 @@ extern const isc::log::MessageID LEGAL_LOG_PGSQL_FATAL_ERROR;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_GET_VERSION; extern const isc::log::MessageID LEGAL_LOG_PGSQL_GET_VERSION;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_INSERT_LOG; extern const isc::log::MessageID LEGAL_LOG_PGSQL_INSERT_LOG;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_INVALID_ACCESS; extern const isc::log::MessageID LEGAL_LOG_PGSQL_INVALID_ACCESS;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_NO_TLS_SUPPORT;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_ROLLBACK; extern const isc::log::MessageID LEGAL_LOG_PGSQL_ROLLBACK;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_START_TRANSACTION; extern const isc::log::MessageID LEGAL_LOG_PGSQL_START_TRANSACTION;
extern const isc::log::MessageID LEGAL_LOG_PGSQL_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_FB_DB; extern const isc::log::MessageID PGSQL_FB_DB;
} // namespace dhcp } // namespace dhcp

View File

@ -50,11 +50,6 @@ and the attempt ended in error. The access string in question - which
should be of the form 'keyword=value keyword=value...' is included in should be of the form 'keyword=value keyword=value...' is included in
the message. the message.
% LEGAL_LOG_PGSQL_NO_TLS_SUPPORT Attempt to configure TLS (unsupported for PostgreSQL): %1
This error message is printed when TLS support was required in the Kea
configuration: Kea was built with this feature disabled for PostgreSQL.
The parameters of the connection are logged.
% LEGAL_LOG_PGSQL_ROLLBACK rolling back PostgreSQL database % LEGAL_LOG_PGSQL_ROLLBACK rolling back PostgreSQL database
The code has issued a rollback call. All outstanding transaction will The code has issued a rollback call. All outstanding transaction will
be rolled back and not committed to the database. be rolled back and not committed to the database.
@ -68,12 +63,6 @@ inserted into multiple tables with multiple INSERT statements
and there may be a need to rollback the whole transaction if and there may be a need to rollback the whole transaction if
any of these INSERT statements fail. any of these INSERT statements fail.
% LEGAL_LOG_PGSQL_TLS_SUPPORT Attempt to configure TLS: %1
This informational message is printed when TLS support was required in
the Kea configuration: The TLS support in PostgreSQL will be initialized but
its configuration is fully managed outside the C API.
The parameters of the connection are logged.
% PGSQL_FB_DB opening PostgreSQL log database: %1 % PGSQL_FB_DB opening PostgreSQL log database: %1
This informational message is logged when a legal log hook library is This informational message is logged when a legal log hook library is
about to open a PostgreSQL log database. The parameters of the about to open a PostgreSQL log database. The parameters of the

View File

@ -13,8 +13,6 @@ extern const isc::log::MessageID PGSQL_HB_DB_READONLY = "PGSQL_HB_DB_READONLY";
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED = "PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED"; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED = "PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED";
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE = "PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE"; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE = "PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE";
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_FAILED = "PGSQL_HB_DB_RECONNECT_FAILED"; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_FAILED = "PGSQL_HB_DB_RECONNECT_FAILED";
extern const isc::log::MessageID PGSQL_HB_NO_TLS_SUPPORT = "PGSQL_HB_NO_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_HB_TLS_SUPPORT = "PGSQL_HB_TLS_SUPPORT";
} // namespace dhcp } // namespace dhcp
} // namespace isc } // namespace isc
@ -28,8 +26,6 @@ const char* values[] = {
"PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED", "database reconnect failed: %1", "PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED", "database reconnect failed: %1",
"PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE", "scheduling attempt %1 of %2 in %3 milliseconds", "PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE", "scheduling attempt %1 of %2 in %3 milliseconds",
"PGSQL_HB_DB_RECONNECT_FAILED", "maximum number of database reconnect attempts: %1, has been exhausted without success", "PGSQL_HB_DB_RECONNECT_FAILED", "maximum number of database reconnect attempts: %1, has been exhausted without success",
"PGSQL_HB_NO_TLS_SUPPORT", "Attempt to configure TLS (unsupported for PostgreSQL): %1",
"PGSQL_HB_TLS_SUPPORT", "Attempt to configure TLS: %1",
NULL NULL
}; };

View File

@ -14,8 +14,6 @@ extern const isc::log::MessageID PGSQL_HB_DB_READONLY;
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_FAILED;
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_ATTEMPT_SCHEDULE;
extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_FAILED; extern const isc::log::MessageID PGSQL_HB_DB_RECONNECT_FAILED;
extern const isc::log::MessageID PGSQL_HB_NO_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_HB_TLS_SUPPORT;
} // namespace dhcp } // namespace dhcp
} // namespace isc } // namespace isc

View File

@ -1,4 +1,4 @@
# Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2024-2025 Internet Systems Consortium, Inc. ("ISC")
# #
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
@ -34,14 +34,3 @@ is attempting to reconnect automatically.
% PGSQL_HB_DB_RECONNECT_FAILED maximum number of database reconnect attempts: %1, has been exhausted without success % PGSQL_HB_DB_RECONNECT_FAILED maximum number of database reconnect attempts: %1, has been exhausted without success
An error message issued when the server failed to reconnect. Loss of connectivity An error message issued when the server failed to reconnect. Loss of connectivity
is typically a network or database server issue. is typically a network or database server issue.
% PGSQL_HB_NO_TLS_SUPPORT Attempt to configure TLS (unsupported for PostgreSQL): %1
This error message is printed when TLS support was required in the Kea
configuration: Kea was built with this feature disabled for PostgreSQL.
The parameters of the connection are logged.
% PGSQL_HB_TLS_SUPPORT Attempt to configure TLS: %1
This informational message is printed when TLS support was required in
the Kea configuration: The TLS support in PostgreSQL will be initialized but
its configuration is fully managed outside the C API.
The parameters of the connection are logged.

View File

@ -2322,21 +2322,6 @@ PgSqlHostDataSourceImpl::PgSqlHostDataSourceImpl(const DatabaseConnection::Param
tls += parameters.count("cert-file"); tls += parameters.count("cert-file");
tls += parameters.count("key-file"); tls += parameters.count("key-file");
tls += parameters.count("cipher-list"); tls += parameters.count("cipher-list");
#ifdef HAVE_PGSQL_SSL
if ((tls > 0) && !PgSqlConnection::warned_about_tls) {
PgSqlConnection::warned_about_tls = true;
LOG_INFO(pgsql_hb_logger, PGSQL_HB_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters_));
PQinitSSL(1);
}
#else
if (tls > 0) {
LOG_ERROR(pgsql_hb_logger, PGSQL_HB_NO_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters_));
isc_throw(DbOpenError, "Attempt to configure TLS for PostgreSQL "
<< "backend (built with this feature disabled)");
}
#endif
// Create unique timer name per instance. // Create unique timer name per instance.
timer_name_ = "PgSqlHostMgr["; timer_name_ = "PgSqlHostMgr[";

View File

@ -46,9 +46,7 @@ extern const isc::log::MessageID PGSQL_LB_GET_SUBID_HWADDR = "PGSQL_LB_GET_SUBID
extern const isc::log::MessageID PGSQL_LB_GET_SUBID_PAGE6 = "PGSQL_LB_GET_SUBID_PAGE6"; extern const isc::log::MessageID PGSQL_LB_GET_SUBID_PAGE6 = "PGSQL_LB_GET_SUBID_PAGE6";
extern const isc::log::MessageID PGSQL_LB_GET_VERSION = "PGSQL_LB_GET_VERSION"; extern const isc::log::MessageID PGSQL_LB_GET_VERSION = "PGSQL_LB_GET_VERSION";
extern const isc::log::MessageID PGSQL_LB_NEGATIVE_LEASES_STAT = "PGSQL_LB_NEGATIVE_LEASES_STAT"; extern const isc::log::MessageID PGSQL_LB_NEGATIVE_LEASES_STAT = "PGSQL_LB_NEGATIVE_LEASES_STAT";
extern const isc::log::MessageID PGSQL_LB_NO_TLS_SUPPORT = "PGSQL_LB_NO_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_LB_ROLLBACK = "PGSQL_LB_ROLLBACK"; extern const isc::log::MessageID PGSQL_LB_ROLLBACK = "PGSQL_LB_ROLLBACK";
extern const isc::log::MessageID PGSQL_LB_TLS_SUPPORT = "PGSQL_LB_TLS_SUPPORT";
extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR4 = "PGSQL_LB_UPDATE_ADDR4"; extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR4 = "PGSQL_LB_UPDATE_ADDR4";
extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR6 = "PGSQL_LB_UPDATE_ADDR6"; extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR6 = "PGSQL_LB_UPDATE_ADDR6";
extern const isc::log::MessageID PGSQL_LB_UPGRADE_EXTENDED_INFO4 = "PGSQL_LB_UPGRADE_EXTENDED_INFO4"; extern const isc::log::MessageID PGSQL_LB_UPGRADE_EXTENDED_INFO4 = "PGSQL_LB_UPGRADE_EXTENDED_INFO4";
@ -103,9 +101,7 @@ const char* values[] = {
"PGSQL_LB_GET_SUBID_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2 for subnet ID %3", "PGSQL_LB_GET_SUBID_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2 for subnet ID %3",
"PGSQL_LB_GET_VERSION", "obtaining schema version information", "PGSQL_LB_GET_VERSION", "obtaining schema version information",
"PGSQL_LB_NEGATIVE_LEASES_STAT", "recount of leases returned a negative value", "PGSQL_LB_NEGATIVE_LEASES_STAT", "recount of leases returned a negative value",
"PGSQL_LB_NO_TLS_SUPPORT", "Attempt to configure TLS (unsupported for PostgreSQL): %1",
"PGSQL_LB_ROLLBACK", "rolling back PostgreSQL database", "PGSQL_LB_ROLLBACK", "rolling back PostgreSQL database",
"PGSQL_LB_TLS_SUPPORT", "Attempt to configure TLS: %1",
"PGSQL_LB_UPDATE_ADDR4", "updating IPv4 lease for address %1", "PGSQL_LB_UPDATE_ADDR4", "updating IPv4 lease for address %1",
"PGSQL_LB_UPDATE_ADDR6", "updating IPv6 lease for address %1, lease type %2", "PGSQL_LB_UPDATE_ADDR6", "updating IPv6 lease for address %1, lease type %2",
"PGSQL_LB_UPGRADE_EXTENDED_INFO4", "upgrading IPv4 leases done in %1 pages with %2 updated leases", "PGSQL_LB_UPGRADE_EXTENDED_INFO4", "upgrading IPv4 leases done in %1 pages with %2 updated leases",

View File

@ -47,9 +47,7 @@ extern const isc::log::MessageID PGSQL_LB_GET_SUBID_HWADDR;
extern const isc::log::MessageID PGSQL_LB_GET_SUBID_PAGE6; extern const isc::log::MessageID PGSQL_LB_GET_SUBID_PAGE6;
extern const isc::log::MessageID PGSQL_LB_GET_VERSION; extern const isc::log::MessageID PGSQL_LB_GET_VERSION;
extern const isc::log::MessageID PGSQL_LB_NEGATIVE_LEASES_STAT; extern const isc::log::MessageID PGSQL_LB_NEGATIVE_LEASES_STAT;
extern const isc::log::MessageID PGSQL_LB_NO_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_LB_ROLLBACK; extern const isc::log::MessageID PGSQL_LB_ROLLBACK;
extern const isc::log::MessageID PGSQL_LB_TLS_SUPPORT;
extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR4; extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR4;
extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR6; extern const isc::log::MessageID PGSQL_LB_UPDATE_ADDR6;
extern const isc::log::MessageID PGSQL_LB_UPGRADE_EXTENDED_INFO4; extern const isc::log::MessageID PGSQL_LB_UPGRADE_EXTENDED_INFO4;

View File

@ -1,4 +1,4 @@
# Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2024-2025 Internet Systems Consortium, Inc. ("ISC")
# #
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
@ -216,22 +216,11 @@ in the PostgreSQL database returned a negative value. This shows a problem
which can be fixed only by an offline direct recount on the database. which can be fixed only by an offline direct recount on the database.
This message is issued only once. This message is issued only once.
% PGSQL_LB_NO_TLS_SUPPORT Attempt to configure TLS (unsupported for PostgreSQL): %1
This error message is printed when TLS support was required in the Kea
configuration: Kea was built with this feature disabled for PostgreSQL.
The parameters of the connection are logged.
% PGSQL_LB_ROLLBACK rolling back PostgreSQL database % PGSQL_LB_ROLLBACK rolling back PostgreSQL database
Logged at debug log level 50. Logged at debug log level 50.
The code has issued a rollback call. All outstanding transaction will The code has issued a rollback call. All outstanding transaction will
be rolled back and not committed to the database. be rolled back and not committed to the database.
% PGSQL_LB_TLS_SUPPORT Attempt to configure TLS: %1
This informational message is printed when TLS support was required in
the Kea configuration: The TLS support in PostgreSQL will be initialized but
its configuration is fully managed outside the C API.
The parameters of the connection are logged.
% PGSQL_LB_UPDATE_ADDR4 updating IPv4 lease for address %1 % PGSQL_LB_UPDATE_ADDR4 updating IPv4 lease for address %1
Logged at debug log level 50. Logged at debug log level 50.
A debug message issued when the server is attempting to update IPv4 A debug message issued when the server is attempting to update IPv4

View File

@ -1625,21 +1625,6 @@ PgSqlLeaseMgr::PgSqlLeaseMgr(const DatabaseConnection::ParameterMap& parameters)
tls += parameters.count("cert-file"); tls += parameters.count("cert-file");
tls += parameters.count("key-file"); tls += parameters.count("key-file");
tls += parameters.count("cipher-list"); tls += parameters.count("cipher-list");
#ifdef HAVE_PGSQL_SSL
if ((tls > 0) && !PgSqlConnection::warned_about_tls) {
PgSqlConnection::warned_about_tls = true;
LOG_INFO(pgsql_lb_logger, PGSQL_LB_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters_));
PQinitSSL(1);
}
#else
if (tls > 0) {
LOG_ERROR(pgsql_lb_logger, PGSQL_LB_NO_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters_));
isc_throw(DbOpenError, "Attempt to configure TLS for PostgreSQL "
<< "backend (built with this feature disabled)");
}
#endif
// Create unique timer name per instance. // Create unique timer name per instance.
timer_name_ = "PgSqlLeaseMgr["; timer_name_ = "PgSqlLeaseMgr[";

View File

@ -187,21 +187,6 @@ void PgSqlStore::open() {
tls += parameters.count("cert-file"); tls += parameters.count("cert-file");
tls += parameters.count("key-file"); tls += parameters.count("key-file");
tls += parameters.count("cipher-list"); tls += parameters.count("cipher-list");
#ifdef HAVE_PGSQL_SSL
if ((tls > 0) && !PgSqlConnection::warned_about_tls) {
PgSqlConnection::warned_about_tls = true;
LOG_INFO(pgsql_fb_logger, LEGAL_LOG_PGSQL_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters));
PQinitSSL(1);
}
#else
if (tls > 0) {
LOG_ERROR(pgsql_fb_logger, LEGAL_LOG_PGSQL_NO_TLS_SUPPORT)
.arg(DatabaseConnection::redactedAccessString(parameters));
isc_throw(DbOpenError, "Attempt to configure TLS for PostgreSQL "
<< "backend (built with this feature disabled)");
}
#endif
// Test schema version first. // Test schema version first.
pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR, pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR,

View File

@ -245,15 +245,9 @@ TEST(PgSqlHostDataSource, OpenDatabase) {
NoDatabaseName); NoDatabaseName);
// Check for SSL/TLS support. // Check for SSL/TLS support.
#ifdef HAVE_PGSQL_SSL
EXPECT_NO_THROW(HostMgr::addBackend(connectionString( EXPECT_NO_THROW(HostMgr::addBackend(connectionString(
PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD, PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD,
0, 0, 0, 0, VALID_CA))); 0, 0, 0, 0, VALID_CA)));
#else
EXPECT_THROW(HostMgr::addBackend(connectionString(
PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD,
0, 0, 0, 0, VALID_CA)), DbOpenError);
#endif
// Tidy up after the test // Tidy up after the test
destroyPgSQLSchema(); destroyPgSQLSchema();

View File

@ -210,15 +210,9 @@ TEST(PgSqlOpenTest, OpenDatabase) {
NoDatabaseName); NoDatabaseName);
// Check for SSL/TLS support. // Check for SSL/TLS support.
#ifdef HAVE_PGSQL_SSL
EXPECT_NO_THROW(LeaseMgrFactory::create(connectionString( EXPECT_NO_THROW(LeaseMgrFactory::create(connectionString(
PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD, PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD,
0, 0, 0, 0, VALID_CA))); 0, 0, 0, 0, VALID_CA)));
#else
EXPECT_THROW(LeaseMgrFactory::create(connectionString(
PGSQL_VALID_TYPE, VALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD,
0, 0, 0, 0, VALID_CA)), DbOpenError);
#endif
// Check for extended info tables. // Check for extended info tables.
const char* EX_INFO = "extended-info-tables=true"; const char* EX_INFO = "extended-info-tables=true";