Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection failed with drogon when mysql db is ssl required #2273

Open
rafeeque1 opened this issue Mar 9, 2025 · 5 comments
Open

connection failed with drogon when mysql db is ssl required #2273

rafeeque1 opened this issue Mar 9, 2025 · 5 comments

Comments

@rafeeque1
Copy link

my mysql db is SSL enabled , when trying to connect it using drogon orm , its giving below error,

ERROR Error(2026) "TLS/SSL error: self-signed certificate in certificate chain" - MysqlConnection.cc:333

its because of

addDbClient(orm::MysqlConfig{host,

here we are just providing generic info , not ssl/tls related information.
i am using ubuntu

@rafeeque1
Copy link
Author

@an-tao please guide me on this, when mysql db is ssl/tls mode required then how to connect with db using config.json , in the orm codebase , i am not seeing any options to include ssl/tls related parameters.

@rafeeque1
Copy link
Author

@an-tao you can see the connection string -> no ssl related info is passed ,

auto cfg = std::get<MysqlConfig>(config);

@an-tao
Copy link
Member

an-tao commented Mar 10, 2025

Currently, Drogon does not support the function to disable certificate verification in the MySQL client. You need to configure formal certificates issued by an SSL certificate authority on the server side instead of using self-signed certificates, or disable the SSL configuration.

@rafeeque1
Copy link
Author

@an-tao i think mariadb-connector will take care the verification, we have to just provide the ssl information in connectionString ,
Example , if manually i am passing the connectionString with sslMode="required" then able to connect.

@an-tao
Copy link
Member

an-tao commented Mar 10, 2025

@rafeeque1 You need to look at the relevant API of the client driver, and then refer to the postgresql processing in drogon to rewrite the mysql part.
Or I'll look into it when I have more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants