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

DB-Check fails if Database requires SSL #113

Open
2 tasks done
Iridias opened this issue Oct 8, 2020 · 2 comments
Open
2 tasks done

DB-Check fails if Database requires SSL #113

Iridias opened this issue Oct 8, 2020 · 2 comments

Comments

@Iridias
Copy link

Iridias commented Oct 8, 2020

Bug Report

Describe the current, buggy behavior
Executing any config-command, that checks the database, e.g. wp config create will result in the following error, if the database requires SSL:
ERROR 9002 (28000): SSL connection is required. Please specify SSL options and retry.

Even if you specify:

--extra-php <<PHP
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
PHP

...because the check is not using PHP, but rather:

// Check DB connection.
		if ( ! Utils\get_flag_value( $assoc_args, 'skip-check' ) ) {
			Utils\run_mysql_command( '/usr/bin/env mysql --no-defaults', $mysql_db_connection_args );
		}

(where mysql_db_connection_args is hardcoded)
and there is currently no way to specify/inject an addition parameter like --ssl!

Describe how other contributors can replicate this bug

Create a MySQL-DB that requires SSL (for Azure-MySQL there is button "Enforce SSL connection")
And then try wp config create with valid credentials.

Describe what you would expect as the correct outcome
Working MySQL-Connection.

Let us know what environment you are running this on
environment independent.

Provide a possible solution

Either respect the addition PHP define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL); or provide a parameter to enable SSL!
wp db export seems to have such an option: wp-cli/db-command#126 (comment)

@adamsewell
Copy link

Also an issue for Digital Ocean's hosted MySQL service. I'd love to see this implemented as well.

@danielbachhuber
Copy link
Member

Open to reviewing a pull request if someone would like to create one. Here is some guidance on our pull request best practices.

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

No branches or pull requests

3 participants