From a626a204056a2bab8e515adf20be96b4f384e0c6 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 21 Jul 2026 11:34:07 +0200 Subject: [PATCH] Skip server certificate verification for MariaDB test connections Follow-up to #297. That change passed `--ssl-verify-server-cert` to silence the MariaDB passwordless-login warning, but that enables certificate verification, which forces TLS checks that fail against self-signed or untrusted certificates and on clients older than 11.4 where verification was off by default. Switch to `--skip-ssl-verify-server-cert`, which explicitly disables verification for the local test database. This silences the warning without turning verification on. The database type auto-detection added in #297 is kept. --- src/Context/FeatureContext.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Context/FeatureContext.php b/src/Context/FeatureContext.php index 53bad681..867f535c 100644 --- a/src/Context/FeatureContext.php +++ b/src/Context/FeatureContext.php @@ -1341,7 +1341,7 @@ public function create_db(): void { } $dbname = self::$db_settings['dbname']; - $ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : ''; + $ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : ''; self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "CREATE DATABASE IF NOT EXISTS $dbname" ] ); } @@ -1353,7 +1353,7 @@ public function test_connection(): void { return; } - $ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : ''; + $ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : ''; $sql_result = self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ @@ -1382,7 +1382,7 @@ public function drop_db(): void { return; } $dbname = self::$db_settings['dbname']; - $ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : ''; + $ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : ''; self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "DROP DATABASE IF EXISTS $dbname" ] ); } @@ -1756,7 +1756,7 @@ public function install_wp( $subdir = '', $version = '' ): void { copy( "{$install_cache_path}.sqlite", "$sqlite_dest_dir/.ht.sqlite.php" ); } } else { - $ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : ''; + $ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : ''; self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "source {$install_cache_path}.sql" ], true /*add_database*/ ); } } else { @@ -1773,7 +1773,7 @@ public function install_wp( $subdir = '', $version = '' ): void { $mysqldump_binary = Utils\force_env_on_nix_systems( $mysqldump_binary ); $help_output = shell_exec( "{$mysqldump_binary} --help" ); $support_column_statistics = ( null !== $help_output && false !== strpos( $help_output, 'column-statistics' ) ); - $ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : ''; + $ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : ''; $command = "{$mysqldump_binary} --no-defaults{$ssl_flag} --no-tablespaces"; if ( $support_column_statistics ) { $command .= ' --skip-column-statistics';