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

mysql connextions overwrite/ignore global settings #6187

Closed
MakerTim opened this issue Jan 3, 2025 · 2 comments
Closed

mysql connextions overwrite/ignore global settings #6187

MakerTim opened this issue Jan 3, 2025 · 2 comments

Comments

@MakerTim
Copy link
Contributor

MakerTim commented Jan 3, 2025

Describe the bug
From 11.4.4-MariaDB and onwards SSL checking is enabled by default.
To disable this behavior/revert the old behavior, one of its ways is to specify it in a configuration file.
Something like: /etc/mysql/my.cnf

[client-mariadb]
disable-ssl-verify-server-cert

This works like a charm, but not for drush, because they use the argument --defaults-file what specifies a file to load configuration from but also disables all other “default” configuration files.

Could we switch and use --defaults-extra-file instead? This still allows connecting with credentials to the database by file and has the least side effects.
But still loads other default files in.
manual for mariadb

To Reproduce
create a configuration file /etc/mysql/my.cnf with the following contents

[client-mariadb]
disable-ssl-verify-server-cert

Connect to a database that has SSL disabled or an invalid certificate.

Expected behavior
A successfull connection to mysql, eg

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is ...

Actual behavior
What happened instead?
Got the following error: ERROR 2026 (HY000): TLS/SSL error: Certificate verification failure: The certificate is NOT trusted.

Workaround
Adding an argument --extra=--skip-ssl to all sql-based commands does work as well, but is not desirable.
Also, for dump --extra-dump=--skip-ssl is needed.

System Configuration

Q A
Drush version? 13.3.3.0
Drupal version? 10.x
PHP version 8.x
OS? Linux

Additional information
Kinda related, or I did find this issue while working on #6183
All started when mysql-client updated on the server.

@MakerTim
Copy link
Contributor Author

MakerTim commented Jan 3, 2025

image

@weitzman
Copy link
Member

weitzman commented Jan 4, 2025

See the link in the PR where we tried this and ultimately decided against.

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