-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add tls support for mysql client #186
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
tlsConfig := &tls.Config{ | ||
MinVersion: tls.VersionTLS10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MinVersion: tls.VersionTLS10, | |
MinVersion: tls.VersionTLS12, |
https://www.rfc-editor.org/rfc/rfc8996.html#name-do-not-use-tls-11
if len(connParams) > 0 { | ||
dsn = dsn + "&" + connParams | ||
} | ||
names[i] = dsn | ||
drv = &mysql.MySQLDriver{} | ||
case pgDriver: | ||
if len(sslCA) > 0 { | ||
panic("postgres driver doesn't support tls yet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic("postgres driver doesn't support tls yet") | |
panic("postgresql driver doesn't support TLS yet") |
|
||
err = mysql.RegisterTLSConfig(customTlsName, tlsConfig) | ||
if err != nil { | ||
panic(fmt.Errorf("failed to register ssl configs, err %v", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic(fmt.Errorf("failed to register ssl configs, err %v", err)) | |
panic(fmt.Errorf("failed to register TLS configs, err %v", err)) |
Close: #185
Add tls config for connecting mysql with tls enabled
Manually test: