-
Notifications
You must be signed in to change notification settings - Fork 500
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 the tls min version to dsn #736
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #736 +/- ##
==========================================
+ Coverage 71.29% 72.57% +1.28%
==========================================
Files 24 24
Lines 5386 5397 +11
==========================================
+ Hits 3840 3917 +77
+ Misses 1301 1234 -67
- Partials 245 246 +1
Continue to review full report at Codecov.
|
tds.go
Outdated
@@ -1150,7 +1150,7 @@ initiate_connection: | |||
} | |||
} | |||
if config == nil { | |||
config, err = msdsn.SetupTLS("", false, p.Host) | |||
config, err = msdsn.SetupTLS("", false, p.Host, 0) |
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.
I try to many way add the test case . but no one can cover this line.
Does anyone care about this problem? |
You can clone the issue and the PR into github.com/microsoft/go-mssqldb. We are going to maintain a fork there. |
if ok { | ||
tlsversion = strings.ToUpper(tlsversion) | ||
switch tlsversion { | ||
case "TLS1.0": |
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.
why not just "1.0" and "1.2" etc since we already know the parameter name is about TLS?
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.
@zhiyunliu we'd consider taking this change in the microsoft fork
github.com/microsoft/go-mssqldb
add the tls min version to dsn parameter.
we can use [tlsminversion=tls1.1] to set tls version.
the dsn like this .(server=localhost;port=1433;database=demo;user id=admin;password=123456;tlsminversion=tls1.3)
#726