Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading/dumping database schema "ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it". No option for "--skip-ssl" for mariadb #54269

Open
omergy opened this issue Jan 20, 2025 · 3 comments

Comments

@omergy
Copy link

omergy commented Jan 20, 2025

Laravel Version

11

PHP Version

8.3

Database Driver & Version

Mariadb

Description

mariadb-client versions 11+ sets the --ssl option to true per default.
This causes the following error whenever you load or dump a schema:

ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it

This can be avoided by using the --skip-ssl command, but Laravel has no option to enter/configure it.

Steps To Reproduce

Example with dumping:

  • install mariadb-client 11 or higher
  • php artisan schema:dump
  • error

Example with loading:

  • install mariadb-client 11 or higher
  • add a dump to database/schema
  • in tests/TestCase.php add use RefreshDatabase trait

namespace Tests;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
  use RefreshDatabase;
}
  • php artisan test
  • error
Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@Raitch
Copy link

Raitch commented Jan 22, 2025

It's relevant to this file vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php however everything there is currently based on database.php config settings. Would be nice if there was a passable argument that appended --skip-ssl to the string. As a temporary solution, one can just add $value .= ' --skip-ssl'; at the end of the connectionString method.

@Raitch
Copy link

Raitch commented Jan 22, 2025

Another solution is to add a my.cnf file to /etc/my.cnf containing:

[mysql]
skip-ssl

Personally I needed to solve this issue locally so I had my docker-composer.yml solve it with voluming the file there.

https://mariadb.com/kb/en/configuring-mariadb-with-option-files/

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

No branches or pull requests

3 participants