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

fix: remove catch for synchronous socket errors and remove validation on nodejs option #2746

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Mar 1, 2021

Our validation for a nodejs option suggested that an option could be a boolean when it can actually only be false or a function. In addition this removes the catching of synchronous errors thrown from socket creation.

NODE-3061

@nbbeeken nbbeeken requested review from durran and emadum March 3, 2021 23:01
@nbbeeken nbbeeken marked this pull request as ready for review March 3, 2021 23:01
Comment on lines -250 to -257
// Override checkServerIdentity behavior
if (!options.checkServerIdentity) {
// Skip the identity check by retuning undefined as per node documents
// https://nodejs.org/api/tls.html#tls_tls_connect_options_callback
result.checkServerIdentity = () => undefined;
} else if (typeof options.checkServerIdentity === 'function') {
result.checkServerIdentity = options.checkServerIdentity;
}
Copy link
Contributor Author

@nbbeeken nbbeeken Mar 8, 2021

Choose a reason for hiding this comment

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

checkServerIdentity is a nodejs TLS option, and nodejs asserts that it is of type function. I suggest that we don't intervene on a boolean type but allow the option to pass directly to the tls API. @mbroadst Thoughts?

NODE-3141

Copy link
Member

Choose a reason for hiding this comment

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

Seems fine for 4.0, but make sure the documentation reflects this, and that your upgrade notes mention it. The change can't be made for 3.x unfortunately.

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

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

LGTM

@nbbeeken nbbeeken merged commit a516903 into 4.0 Mar 11, 2021
@nbbeeken nbbeeken deleted the NODE-3061/tls-checkServerIdentity branch March 11, 2021 17:27
ljhaywar pushed a commit that referenced this pull request Nov 9, 2021
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.

4 participants