Skip server certificate verification for MariaDB test connections#338
Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Context/FeatureContext.php`:
- Around line 1344-1345: The MariaDB command construction in the database setup
flow, including this `self::run_sql` call and the other MariaDB call sites in
`FeatureContext.php`, must not use `--skip-ssl-verify-server-cert` because it
permits unencrypted connections. Replace it with a MariaDB option that only
disables certificate verification, or apply the existing option exclusively when
`WP_CLI_TEST_DBHOST` resolves to a loopback host, while preserving secure
connections for non-local hosts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0a129a36-9f4e-437e-a4cc-a04b77b5d70a
📒 Files selected for processing (1)
src/Context/FeatureContext.php
Summary
Follow-up to #297. That change passed
--ssl-verify-server-certto the MariaDBclient calls in the test harness to silence the passwordless-login warning. That
flag enables certificate verification though, which forces TLS server
certificate checks that fail against self-signed or untrusted certificates, and
on clients older than 11.4 where verification was off by default.
Approach
Switch the five call sites to
--skip-ssl-verify-server-cert, which explicitlydisables verification for the local test database. It silences the same warning
without turning verification on, so it also works when the client would
otherwise reject the self-signed certificate. The database type auto-detection
added in #297 is kept.
Summary by CodeRabbit