Skip to content

Commit a626a20

Browse files
committed
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.
1 parent fce2eb2 commit a626a20

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/Context/FeatureContext.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ public function create_db(): void {
13411341
}
13421342

13431343
$dbname = self::$db_settings['dbname'];
1344-
$ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : '';
1344+
$ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : '';
13451345
self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "CREATE DATABASE IF NOT EXISTS $dbname" ] );
13461346
}
13471347

@@ -1353,7 +1353,7 @@ public function test_connection(): void {
13531353
return;
13541354
}
13551355

1356-
$ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : '';
1356+
$ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : '';
13571357
$sql_result = self::run_sql(
13581358
self::$mysql_binary . ' --no-defaults' . $ssl_flag,
13591359
[
@@ -1382,7 +1382,7 @@ public function drop_db(): void {
13821382
return;
13831383
}
13841384
$dbname = self::$db_settings['dbname'];
1385-
$ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : '';
1385+
$ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : '';
13861386
self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "DROP DATABASE IF EXISTS $dbname" ] );
13871387
}
13881388

@@ -1756,7 +1756,7 @@ public function install_wp( $subdir = '', $version = '' ): void {
17561756
copy( "{$install_cache_path}.sqlite", "$sqlite_dest_dir/.ht.sqlite.php" );
17571757
}
17581758
} else {
1759-
$ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : '';
1759+
$ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : '';
17601760
self::run_sql( self::$mysql_binary . ' --no-defaults' . $ssl_flag, [ 'execute' => "source {$install_cache_path}.sql" ], true /*add_database*/ );
17611761
}
17621762
} else {
@@ -1773,7 +1773,7 @@ public function install_wp( $subdir = '', $version = '' ): void {
17731773
$mysqldump_binary = Utils\force_env_on_nix_systems( $mysqldump_binary );
17741774
$help_output = shell_exec( "{$mysqldump_binary} --help" );
17751775
$support_column_statistics = ( null !== $help_output && false !== strpos( $help_output, 'column-statistics' ) );
1776-
$ssl_flag = 'mariadb' === self::$db_type ? ' --ssl-verify-server-cert' : '';
1776+
$ssl_flag = 'mariadb' === self::$db_type ? ' --skip-ssl-verify-server-cert' : '';
17771777
$command = "{$mysqldump_binary} --no-defaults{$ssl_flag} --no-tablespaces";
17781778
if ( $support_column_statistics ) {
17791779
$command .= ' --skip-column-statistics';

0 commit comments

Comments
 (0)