Skip to content

[12.x] Add option to disable MySQL ssl when restoring or squashing migrations#55683

Merged
taylorotwell merged 2 commits into
laravel:12.xfrom
andersonls:feat/disable-mysql-ssl
May 9, 2025
Merged

[12.x] Add option to disable MySQL ssl when restoring or squashing migrations#55683
taylorotwell merged 2 commits into
laravel:12.xfrom
andersonls:feat/disable-mysql-ssl

Conversation

@andersonls

Copy link
Copy Markdown
Contributor

Newer versions of the MySQL client are enforcing a more strict SSL certificate check and resulting in the following error when squashing migrations or running migrate:fresh

ERROR 2026 (HY000): TLS/SSL error: self-signed certificate in certificate chain

Currently, to bypass this error we need to edit the MySQL config file. To make things easier, this PR adds a new option to disable SSL when executing the commands to dump/restore MySQL database.

@Jellyfrog

Copy link
Copy Markdown
Contributor

I don't think this is correct at all @andersonls, --ssl is both deprecated and removed in newer Mysql releases, and not a mysql argument, it's for mysqld. ssl-mode seems to be the argument you're looking for https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_ssl-mode

$ mysql -V
mysql  Ver 14.14 Distrib 8.0.0-dmr, for Linux (x86_64) using  EditLine wrapper
$ mysql --ssl=off
mysql: [ERROR] unknown variable 'ssl=off'

@Jellyfrog Jellyfrog mentioned this pull request May 19, 2025
3 tasks
@andersonls

Copy link
Copy Markdown
Contributor Author

@Jellyfrog please check #55758, there is a WIP fixing this. My system was aliasing the mysql exec to mariadb and mariadb still uses the --ssl=off option.

@gazben

gazben commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

@taylorotwell Why was this change reverted here? 1bfad30

With the new Debian 13 release, the mariadb-dump command defaults to ssl, and there is no way to modify the connection string to add the --skip-ssl flag to the baseDumpCommand() function.

@andersonls

Copy link
Copy Markdown
Contributor Author

@gazben in short, because the --ssl=off option is for the mariaDb client, the native MySQL client uses a different option. As a workaround you can disable in the config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants