drogon
drogon copied to clipboard
Postgresql is set to sslmode=require -> connection failed.
Describe the bug void DbClientManager::addDbClient(const DbConfig &config) { if (std::holds_alternative<PostgresConfig>(config)) { #if USE_POSTGRESQL auto &cfg = std::get<PostgresConfig>(config); auto connStr = buildConnStr(cfg.host, cfg.port, cfg.databaseName, cfg.username, cfg.password, cfg.characterSet);
why we are using only host , port , databaseName, username etc only? what if my postgresql set sslmode=require , then how to include sslmode etc into connection string
ConnectionString = "dbname=defaultdb user=avnadmin password={PASSWORD} host={HOST} port=22389 sslmode=require" if sslmode=require on postgresql
To Reproduce Steps to reproduce the behavior:
-
Go to aiven cloud (aiven.io)
-
create a postgresql
-
try to connect with drogon
-
and see the error -> ERROR !!!Pg connection failed: FATAL: no pg_hba.conf entry for host {HOST}, user {USER}, database {DB_NAME}, no encryption
PgConnection.cc:161
Desktop (please complete the following information):
- OS: ubuntu
- i am using drogon from conan package manager.
You could use the following option in the configuration file:
//connect_options: extra options for the connection. Only works for PostgreSQL now.
//For more information, see https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-CONNECT-OPTIONS
"connect_options": { "statement_timeout": "1s" }
@an-tao i tried , but still getting error , can you please give me one example , also include if my postgresql has server.pem and server.key then how to connect along with certificate