Enabling support for TLS-verified mysql server#84
Open
g-saransh wants to merge 2 commits intoprestodb:mainfrom
Open
Enabling support for TLS-verified mysql server#84g-saransh wants to merge 2 commits intoprestodb:mainfrom
g-saransh wants to merge 2 commits intoprestodb:mainfrom
Conversation
yabinma
reviewed
Apr 1, 2026
yabinma
reviewed
Apr 1, 2026
yabinma
reviewed
Apr 1, 2026
utils/utils.go
Outdated
| if db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?parseTime=true", | ||
| mySQLCfg.Username, mySQLCfg.Password, mySQLCfg.Server, mySQLCfg.Database)); err != nil { | ||
| if db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?tls=%t&parseTime=true", | ||
| mySQLCfg.Username, mySQLCfg.Password, mySQLCfg.Server, mySQLCfg.Database, mySQLCfg.Tls)); err != nil { |
Member
There was a problem hiding this comment.
"Note: the corresponding CA certificate should be added to the system's trust store for TLS verification to work." Agree. It has to add the CA in the system truststore. It's possible to add a complete solution so that customized CA can be specified as well(a ca path maybe)?
Author
There was a problem hiding this comment.
Yes, thanks for the comment Yabin. I have added logic to handle custom certificate path. For completeness, I also added support for mutual TLS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for TLS-verified mysql server. By default, it maintains the original behavior of disabling TLS verification.
For simple TLS,
For mutual TLS,