From ae553f89664a4baade80020856c9ff66323de963 Mon Sep 17 00:00:00 2001 From: myuzhobcplidtkieno <62526817+myuzhobcplidtkieno@users.noreply.github.com> Date: Wed, 8 Apr 2020 08:08:28 +1200 Subject: Added the ability to use TLS when connecting to a database. (#24348) * Added the ability to use TLS when connecting to a database. * Trying to kickstart CI checks * Revert the kickstart change Co-authored-by: myuzhobcplidtkieno Co-authored-by: Giacomo Pozzoni --- src/server/database/Updater/DBUpdater.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/server/database/Updater/DBUpdater.cpp') diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index dca6d034784..bc83e0fe43e 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -188,7 +188,7 @@ bool DBUpdater::Create(DatabaseWorkerPool& pool) try { DBUpdater::ApplyFile(pool, pool.GetConnectionInfo()->host, pool.GetConnectionInfo()->user, pool.GetConnectionInfo()->password, - pool.GetConnectionInfo()->port_or_socket, "", temp); + pool.GetConnectionInfo()->port_or_socket, "", pool.GetConnectionInfo()->ssl, temp); } catch (UpdateException&) { @@ -323,12 +323,13 @@ template void DBUpdater::ApplyFile(DatabaseWorkerPool& pool, Path const& path) { DBUpdater::ApplyFile(pool, pool.GetConnectionInfo()->host, pool.GetConnectionInfo()->user, pool.GetConnectionInfo()->password, - pool.GetConnectionInfo()->port_or_socket, pool.GetConnectionInfo()->database, path); + pool.GetConnectionInfo()->port_or_socket, pool.GetConnectionInfo()->database, pool.GetConnectionInfo()->ssl, path); } template void DBUpdater::ApplyFile(DatabaseWorkerPool& pool, std::string const& host, std::string const& user, - std::string const& password, std::string const& port_or_socket, std::string const& database, Path const& path) + std::string const& password, std::string const& port_or_socket, std::string const& database, std::string const& ssl, + Path const& path) { std::vector args; args.reserve(8); @@ -372,6 +373,9 @@ void DBUpdater::ApplyFile(DatabaseWorkerPool& pool, std::string const& hos // Set max allowed packet to 1 GB args.push_back("--max-allowed-packet=1GB"); + if (ssl == "ssl") + args.push_back("--ssl"); + // Database if (!database.empty()) args.push_back(database); -- cgit v1.2.3