Skip to content

Commit 17839ea

Browse files
authored
docs(mssql): describe MSSQL issue with negative certificates (#3417)
* docs(mssql): describe MSSQL issue with negative certificates * docs: use links * docs: wording
1 parent 0139214 commit 17839ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/modules/mssql.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ Please run the following command to add the MS SQL Server module to your Go depe
1414
go get github.com/testcontainers/testcontainers-go/modules/mssql
1515
```
1616

17+
!!!info
18+
To use this module with Go 1.23+, set `GODEBUG=x509negativeserial=1`. See the related issue in the [mssql-docker repository](https://github.com/microsoft/mssql-docker/issues/895) for details.
19+
20+
```shell
21+
# append to any existing GODEBUG flags instead of overwriting
22+
export GODEBUG="${GODEBUG:+$GODEBUG,}x509negativeserial=1"
23+
```
24+
This occurs because:
25+
- Go 1.23+ has stricter certificate validation that rejects certificates with negative serial numbers by default
26+
- The `x509negativeserial=1` flag temporarily re‑enables acceptance of such certificates
27+
Note: This stricter check in Go 1.23+ is a security hardening. Prefer using images with fixed certificates (see below). Use the GODEBUG workaround only with affected images and in test environments.
28+
29+
!!!info
30+
This is fixed in SQL2019 CU32 and SQL2022 CU18 (see [SQL Server 2022 CU18 — KB 3867855](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate18#3867855)).
31+
32+
Prefer using container images based on these (or newer) CUs to avoid setting `GODEBUG`.
33+
1734
## Usage example
1835

1936
<!--codeinclude-->

0 commit comments

Comments
 (0)