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

Allow tls=false override with mongodb+srv protocol #1165

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

jyemin
Copy link
Contributor

@jyemin jyemin commented Aug 2, 2023

@jyemin jyemin self-assigned this Aug 2, 2023
new ConnectionString('mongodb+srv://test5.test.build.10gen.cc') | true
new ConnectionString('mongodb+srv://test5.test.build.10gen.cc/?tls=true') | true
new ConnectionString('mongodb+srv://test5.test.build.10gen.cc/?ssl=true') | true
new ConnectionString('mongodb+srv://test5.test.build.10gen.cc/?tls=false') | false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only one that failed. The others are just to increase test coverage.

if (isSrvProtocol && !combinedOptionsMaps.containsKey("ssl")) {
combinedOptionsMaps.put("ssl", singletonList("true"));
if (isSrvProtocol && !(combinedOptionsMaps.containsKey("tls") || combinedOptionsMaps.containsKey("ssl"))) {
combinedOptionsMaps.put("tls", singletonList("true"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to the non-deprecated parameter name

Copy link
Member

Choose a reason for hiding this comment

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

Ack

@jyemin jyemin requested a review from rozza August 2, 2023 02:32
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

LGTM - nice and subtle bug that one.

if (isSrvProtocol && !combinedOptionsMaps.containsKey("ssl")) {
combinedOptionsMaps.put("ssl", singletonList("true"));
if (isSrvProtocol && !(combinedOptionsMaps.containsKey("tls") || combinedOptionsMaps.containsKey("ssl"))) {
combinedOptionsMaps.put("tls", singletonList("true"));
Copy link
Member

Choose a reason for hiding this comment

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

Ack

@jyemin jyemin merged commit b212fb8 into mongodb:master Aug 2, 2023
54 checks passed
@jyemin jyemin deleted the j4915 branch August 2, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants