You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
MySQL database driver reads a CA certificate file from the path specified by x-tls-ca parameter, if tis parameter in the DSN is not true, false, or skip-verify. This helps establishing TLS connections to the database with the CA file. However, when the TLS configuration is already registered using mysql.RegisterTLSConfig, the driver overrides it, reading x-tls-ca parameter even if the file does not exist (and occurs an error).
Steps to Reproduce
Register a tls.Config using mysql.RegisterTLSConfig
Use migrate.New with the registered TLS configuration name (e.g. ...?tls=aws)
An error occurs: open : no such file or directory
Expected Behavior
I think MySQL driver of migrate should ignore registering TLS config from the DSN if x-tls-ca is not provided. Checking the configuration is already registered is a better solution, but go-mysql-driver does not provide a method to check the configuration name is known or not.
Migrate Version
v4.16.2
Loaded Source Drivers
file
Loaded Database Drivers
mysql, stub
Go Version
go version go1.20.7 darwin/arm64
Stacktrace
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
siketyan
changed the title
mysql: Open(url string) should ignore unknown tls parameters if already registered
mysql: Opening a connection leads an error with a registered custom TLS configuration
Aug 6, 2023
Describe the Bug
MySQL database driver reads a CA certificate file from the path specified by
x-tls-ca
parameter, iftis
parameter in the DSN is nottrue
,false
, orskip-verify
. This helps establishing TLS connections to the database with the CA file. However, when the TLS configuration is already registered usingmysql.RegisterTLSConfig
, the driver overrides it, readingx-tls-ca
parameter even if the file does not exist (and occurs an error).Steps to Reproduce
tls.Config
usingmysql.RegisterTLSConfig
migrate.New
with the registered TLS configuration name (e.g....?tls=aws
)open : no such file or directory
Expected Behavior
I think MySQL driver of migrate should ignore registering TLS config from the DSN if
x-tls-ca
is not provided. Checking the configuration is already registered is a better solution, but go-mysql-driver does not provide a method to check the configuration name is known or not.Migrate Version
v4.16.2
Loaded Source Drivers
file
Loaded Database Drivers
mysql, stub
Go Version
go version go1.20.7 darwin/arm64
Stacktrace
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: