Skip to content

Commit f7567d5

Browse files
Copilotswissspidy
andcommitted
Add --ssl-verify-server-cert flag for MariaDB to suppress passwordless login warning
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent f8228e1 commit f7567d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DB_Command.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,11 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $int
18351835
$required['default-character-set'] = constant( 'DB_CHARSET' );
18361836
}
18371837

1838+
// Add --ssl-verify-server-cert for MariaDB to suppress passwordless login warning.
1839+
if ( 'mariadb' === Utils\get_db_type() && ! isset( $assoc_args['ssl-verify-server-cert'] ) ) {
1840+
$required['ssl-verify-server-cert'] = true;
1841+
}
1842+
18381843
// Using 'dbuser' as option name to workaround clash with WP-CLI's global WP 'user' parameter, with 'dbpass' also available for tidiness.
18391844
if ( isset( $assoc_args['dbuser'] ) ) {
18401845
$required['user'] = $assoc_args['dbuser'];
@@ -2075,6 +2080,7 @@ private static function get_mysql_args( $assoc_args ) {
20752080
'ssl-fips-mode',
20762081
'ssl-key',
20772082
'ssl-mode',
2083+
'ssl-verify-server-cert',
20782084
'syslog',
20792085
'table',
20802086
'tee',

0 commit comments

Comments
 (0)