mssql PMDA: update default driver to 18, add trust_server_certificate option#2589
mssql PMDA: update default driver to 18, add trust_server_certificate option#2589natoscott wants to merge 1 commit into
Conversation
… option
ODBC Driver 17 for SQL Server has reached end of support. Driver 18 is
the current release but enables TLS encryption by default and rejects
self-signed certificates, causing the PMDA to fail at startup with:
SSL Provider: certificate verify failed: self-signed certificate
This is the common case on Linux SQL Server installs which use a
self-signed certificate by default.
Changes:
- Update default driver from 17 to 18 in pmdamssql.python and mssql.conf
- Add optional trust_server_certificate key under [connection] in mssql.conf
that appends TrustServerCertificate=YES to the ODBC connection string
- Remove stray debug print("trusted?", self.trusted) from startup path
The new option defaults to false so existing deployments with valid
CA-signed certificates are unaffected.
Tested on SQL Server 2025 (Linux) with ODBC Driver 18.
|
@natoscott The patch looks good. However if you do not mind to wait for a few days, I would like to understand what might be consequences for some older platforms like MSSQL running on rhel-8.10 or so. I guess it takes me 2-3 days to prepare the environment and test it. |
|
@kurik sure thing, no rush. |
|
@natoscott I have tested upgrade scenarios as well as I did some compatibility checks with older MSSQL versions and all seems to work correctly. The only issue is failing test 1337. This test was a bit unstable even with the v17 driver, however with the v18 driver it fails reliably. The error message is: With the exception of the failing test, I am OK to merge this PR. |
|
Upon closer inspection of the failing test, the issue is that Fixing this makes the test pass. Note: I am using MS's official MSSQL containers for the testing: https://mcr.microsoft.com/artifact/mar/mssql/server/tags |
|
One more ( hopefully the last :-) ) comment regarding the test: The test uses |
ODBC Driver 17 for SQL Server has reached end of support. Driver 18 is the current release but enables TLS encryption by default and rejects self-signed certificates, causing the PMDA to fail at startup with:
SSL Provider: certificate verify failed: self-signed certificate
This is the common case on Linux SQL Server installs which use a self-signed certificate by default.
Changes:
The new option defaults to false so existing deployments with valid CA-signed certificates are unaffected.
Tested on SQL Server 2025 (Linux) with ODBC Driver 18.