-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: remove catch for synchronous socket errors and remove validation on nodejs option #2746
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
Conversation
// 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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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