Skip to content
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

feat: Added Params for CA Certs in MSSQL Config #698

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

pangjunrong
Copy link
Contributor

When establishing an SSL connection to MSSQL currently, bb8 times out due to a mismatch in CA certificates since underlying default behavior from tiberius is to validate server certificate against system-truststore.

This change enables 2 new parameters in the connection string for MSSQL to address custom CA certificate use cases (description extracted from tiberius config documentation):

  • trust_server_certificate: If set, the server certificate will not be validated and it is accepted as-is
  • trust_server_certificate_ca: If set, the server certificate will be validated against the given CA certificate in in addition to the system-truststore. Useful when using self-signed certificates on the server without having to disable the trust-chain.

This will resolve issue #509 and is a requested feature at the end of the thread.

@wangxiaoying
Copy link
Contributor

wangxiaoying commented Oct 18, 2024

Hi @pangjunrong , thanks for the PR. It looks good to me.

Can you fix the formatting problem of the code? You can do it by running cargo fmt.

Also, can you add this new parameter to the documentation here as well? You can do this by editing this markdown file.

P.S., You may also need to upgrade the version of tiberius in order to have the _ca function.

@pangjunrong
Copy link
Contributor Author

Hey @wangxiaoying, thanks for the quick reply! I've fixed the formatting and added the new parameters into the documentation.

So I updated tiberius & bb8-tiberius to 0.7.3 and 0.8.0 respectively as those versions contain the first instances of _ca function but I noticed that anything above tiberius 0.5.16 no longer contained the QueryResult method (unfortunately deprecated) which is used across the MSSQL implementation. I've tried my hand at replacing it with the new QueryStream method; hoping you can help out on this if you see anything amiss!

@wangxiaoying wangxiaoying merged commit a2b9956 into sfu-db:main Oct 18, 2024
2 checks passed
@wangxiaoying
Copy link
Contributor

Thank you @pangjunrong !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants