Repository navigation
Resolve native database TLS settings as PHP Server 2.9.10 does - #559
Conversation
Native now reads DB_SSLMODE/DB_SSL_MODE, DB_SSLROOTCERT/DB_SSL_ROOT_CERT, a DB_URL's sslmode/sslrootcert and MYSQL_ATTR_SSL_CA with the rules of PHP's DatabaseTlsConfiguration, and refuses the same configurations with database_tls_configuration_invalid. TLS always comes from the resolved settings, including when DB_URL is set, which native previously let override DB_SSLMODE. A failed connection that required TLS refuses startup with database_tls_connection_failed, and readiness reports PHP's TLS snapshot. native-database-tls.sh runs PHP's TLS qualification cases on its fixtures against the native binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/rust-server-port.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/rust-server-port.md
|
Sonar's security gate flagged two literal URL passwords in the |
# Conflicts: # docs/rust-server-port.md
|
|
The PostgreSQL and MySQL fixture jobs check that a wrong CA and a wrong hostname refuse native's schema check. With required TLS, native now names that refusal database_tls_connection_failed, as PHP Server 2.9.10 does, instead of storage_unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Updated with main after #523 merged (a454c62; main.rs merged cleanly, unit tests pass locally). The earlier fixtures run 39526376043 on 10c29d7 failed two jobs:
I cancelled the superseded runs on 10c29d7 and a454c62. The run on 2185a87 is the qualifying one. |
|



Part of #325 (operations gate:
DW_*/DB_*configuration compatibility).PHP Server 2.9.10 (#545) added explicit database TLS settings. With this change, native reads the same settings, applies the same rules, and refuses the same configurations. One deployment configuration now means the same thing to both servers.
Behavior. The new
database_tlsmodule follows PHP'sDatabaseTlsConfigurationandconfig/database.php:Inputs.
DB_SSLMODE, with the Helm chart's aliasDB_SSL_MODE;DB_SSLROOTCERT, with the aliasDB_SSL_ROOT_CERT;DB_URL'ssslmode/sslrootcert;MYSQL_ATTR_SSL_CA.Laravel's
env()reading applies (null,empty, explicitly empty values). Mode names are normalized (required,verify_identity, …), and PostgreSQL defaults toprefer.Refusals (
database_tls_configuration_invalid, with PHP's messages):DB_SSLMODEorDB_SSLROOTCERT;disable,requireandverify-full;localhostandDB_SOCKET);DB_URL. Native used to ignoreDB_SSLMODEandDB_SSLROOTCERTwheneverDB_URLwas set. TLS now always comes from the resolved settings, and TLS spellings that only SQLx reads are removed from the URL before parsing.Startup and readiness.
database_tls_connection_failed./api/readycarries PHP'schecks.database.tlssnapshot (mode, encrypted, CA and hostname verification, evidence), scopedrust_to_configured_database_endpoint.Known difference. With no configured mode, native MySQL uses TLS when the server offers it, while PHP sets no TLS options. Both report the mode as unset.
Qualification.
scripts/conformance/native-database-tls.sh NATIVE_BINARYruns PHP'squalify-database-tls.shcases on its fixtures (scripts/ci/database-tls-compose.yaml, pinned images):disableconnects;requireis refused.The database side confirms the transport. PostgreSQL's
pg_stat_sslshows native's connections encrypted, and the MySQL/MariaDB fixture accounts accept only TLS.Local run on this commit: all 24 cases passed, and the fixtures were retired afterwards.
Checks. The four
database_tlsunit tests mirror PHP'sDatabaseTlsConfigurationTestcases. The native lib suite (124) and the SQLite execution suite (287) pass.🤖 Generated with Claude Code