-
Notifications
You must be signed in to change notification settings - Fork 506
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
Go version 1.18 TLS 1.0 and 1.1 disabled by default client-side (sql server old TLS versions not work) #726
Comments
I'm using go version go1.18 darwin/amd64, adding GODEBUG environment (os env or go setEnv) still give TLS Handshake failed error. Any other workaround? |
Is strange that the GODEBUG don't work, you make a double check after the set to verify that is set correctly? You always can downgrade GO to 1.17 (like I do it) |
Yes, i double check it:
|
Sure i will check later. thanks. |
One thing you may use as a workaround (but it's far away from best practice 😉) is to disable encryption in your connection string. I won't recommend this workaround, but if you may have coded some in-house apps with no critical data, you may think about it. Hopefully there will be a solution soon for this driver. As I've seen Microsoft will take care about this project, so maybe we get a fix in near future. Someone mentioned a downgrade, but this did not work for me :( Had the same issue with 1.17 :/ Maybe because of the updated drivers? |
I tried both combination of encrypt=False and TrustServerCertificate=True in the connection string still have TLS issue. |
In package crypto/tls:
So i have to go mod vendor to modify the conn_str.go of the driver and set the minimal version back to TLS 1.0 manually and it works now. This is relate to proposal from @gus2286 to pass Config.MinVersion |
This does not work, because the standard library reads the environment variable at startup: Can we please triage this |
I tried to set GODEBUG parameter . it doesn't work well . |
Any updates on this? |
Just ran into this situation. |
Yes, it doesn't work. The environment variable should be set before the app is started. Here are some common options to set it:
And please note that it only works for go1.18. The flag has been removed in go1.19 (golang/go@f0ee7fd). |
fmt.Sprintf("server=%s;port=%d;database=%s;user id=%s;password=%s;trustservercertificate=true;encrypt=DISABLE",
|
@WenTao-Love This saved my day thnx |
Hi and thanks for the work you do.
I just install the last GO compilator version 1.18 and the connections to databases where still uses the TLS 1.0 are broken.
Error: TLS Handshake failed: tls: server selected unsupported protocol version 301
There are a workaround for the moment using the environment variable
GODEBUG=tls10default=1
, BUT in the next version GO 1.19, this environment variable will be disabled.My proposal is to have the way to pass the TLS config param
Config.MinVersion to VersionTLS10
in some way to the driver, that's will be possible?https://tip.golang.org/doc/go1.18#tls10
Thanks
Gus
The text was updated successfully, but these errors were encountered: