Skip to content

Pull in the default SSL config for DB backup/restore commands - #19366

Open
brandonkelly wants to merge 6 commits into
5.xfrom
feature/default-ssl-conf
Open

Pull in the default SSL config for DB backup/restore commands#19366
brandonkelly wants to merge 6 commits into
5.xfrom
feature/default-ssl-conf

Conversation

@brandonkelly

@brandonkelly brandonkelly commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

Updates craft\db\mysql\Schema::_createDumpConfigFile() to pull in the default ssl_* values (via mysql --print-defaults) if none of the PDO::MYSQL_ATTR_SSL_* DB connection attributes are set.

Also adds attribute checks for PDO::MYSQL_ATTR_SSL_CAPATH and MYSQL_ATTR_SSL_CIPHER.

Related issues

Copilot AI review requested due to automatic review settings August 3, 2026 17:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MySQL backup/restore config generation so that when PDO SSL attributes aren’t explicitly set, Craft carries over the default MySQL SSL settings that would normally come from the system/user my.cnf chain (via mysql --print-defaults) even though --defaults-file causes those config files to be ignored.

Changes:

  • Expand SSL attribute handling in _createDumpConfigFile() to include CAPATH and CIPHER, and fall back to config-file-derived SSL defaults when no SSL attributes are set.
  • Add _sslDefaultsFromConfigFiles() to extract ssl_* directives from mysql --print-defaults output and append them to the generated temporary my.cnf.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/db/mysql/Schema.php
Comment thread src/db/mysql/Schema.php
brandonkelly and others added 2 commits August 3, 2026 11:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@brandonkelly
brandonkelly force-pushed the feature/default-ssl-conf branch from a79329c to 74b3915 Compare August 3, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants