-
Notifications
You must be signed in to change notification settings - Fork 67
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 1.23: Unable to connect to SQL Server 2022 docker image with TLS error #217
Comments
@giautm is there something you'd expect to change in the driver for this? |
When is someone violating RFC, why it must be always Microsoft? RFC 5280 section 4.1.2.2 |
@shueybubbles maybe wrap the error with an explanation why is that so? Or document the error as a well-know issue? This driver acts like a bridge between Go and Microsoft SQL Server. |
Another, less ideal solution would be to fork the cert parser and use it as the default for this library. However, this could cause more problems. It would be better to spend that time fixing the root cause, whether it's in the Docker image or the SQL server itself. |
See microsoft/go-mssqldb#217 , microsoft/mssql-docker#895 The mssql tests currently fail with the error:"TLS Handshake failed: tls: failed to parse certificate from server: x509: negative serial number"
The change in
crypto/tls
returns an error for the negative serial number in the certificate.https://pkg.go.dev/crypto/x509#ParseCertificate
When running the bellow program, I got a TLS error RANDOMLY with the container. Because sometime the container starts and generates correct certs, so no errors happen.
$ go run ./main.go 2024/08/28 02:24:11 Run query failure: TLS Handshake failed: tls: failed to parse certificate from server: x509: negative serial number exit status 1
To Reproduce
Start the container
Then run the main.go with
go run ./main.go
The text was updated successfully, but these errors were encountered: