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

mysql should allow tls=preferred option not only skip-verify #1013

Open
sjones4 opened this issue Dec 18, 2023 · 0 comments
Open

mysql should allow tls=preferred option not only skip-verify #1013

sjones4 opened this issue Dec 18, 2023 · 0 comments

Comments

@sjones4
Copy link

sjones4 commented Dec 18, 2023

Describe the Bug
The MySQL golang driver supports tls=preferred to use tls when available, else connect without tls:
https://github.com/go-sql-driver/mysql/tree/master#tls

when this parameter is specified in the url an error occurs:

error: open : no such file or directory

there is special handling for tls=skip-verify but not for tls=preferred:
https://github.com/golang-migrate/migrate/blob/v4.16.2/database/mysql/mysql.go#L158

Steps to Reproduce
perform a mysql database migration using the url parameter tls=preferred

Expected Behavior
database migration is successful

Migrate Version
4.16.2

Loaded Source Drivers
any

Loaded Database Drivers
mysql

Go Version
go version go1.21.0 linux/amd64

Stacktrace
N/A

Additional context
This option can be important if mysql is running with --require-secure-transport or non TLS connections are otherwise not permitted.

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

No branches or pull requests

1 participant