Skip to content

Conversation

isabelatkinson
Copy link
Contributor

@isabelatkinson isabelatkinson commented Aug 20, 2025

Fixes handling of the tlsInsecure option in a URI. tlsInsecure=bool now sets TlsOptions::allow_invalid_certificates and TlsOptions::allow_invalid_hostnames (if openssl-tls is enabled) to the value of bool.

Note that tlsInsecure can only be set via a URI; the ConnectionString and ClientOptions types both store the TlsOptions type, which only has fields for the more granular options.

@isabelatkinson isabelatkinson marked this pull request as ready for review August 20, 2025 17:20
@isabelatkinson isabelatkinson requested a review from a team as a code owner August 20, 2025 17:20
)?;
}

if keys.contains(TLS_INSECURE) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md#conflicting-tls-options

We don't currently parse tlsAllowInvalidHostnames (RUST-1896), but I added the logic for it here so that we have the validation once we support the option in the URI.

@isabelatkinson isabelatkinson merged commit b918cd6 into mongodb:main Aug 20, 2025
21 checks passed
@isabelatkinson isabelatkinson deleted the tls-insecure branch August 20, 2025 19:44
abr-egn pushed a commit to abr-egn/mongo-rust-driver that referenced this pull request Aug 21, 2025
abr-egn added a commit that referenced this pull request Aug 21, 2025
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.

3 participants