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

tls: include invalid method name in thrown error #27390

Closed

Conversation

sam-github
Copy link
Contributor

When an invalid TLS method name error is thrown, include the invalid
name in the error message.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Apr 24, 2019
doc/api/errors.md Outdated Show resolved Hide resolved
@sam-github sam-github force-pushed the invalid-method-name-in-error branch from e847200 to cc0576f Compare April 24, 2019 19:59
When an invalid TLS method name error is thrown, include the invalid
name in the error message.
@sam-github sam-github force-pushed the invalid-method-name-in-error branch from cc0576f to 5076542 Compare April 24, 2019 20:00
@nodejs-github-bot
Copy link
Collaborator

@@ -627,7 +627,8 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
max_version = TLS1_2_VERSION;
method = TLS_client_method();
} else {
THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "Unknown method");
const std::string msg("Unknown method: ");
THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, (msg + * sslmethod).c_str());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case this looks like extraneous white space -- the cpp linter doesn't allow *sslmethod here, though it does in all the calls to strcmp() above.

@sam-github
Copy link
Contributor Author

All green. @mscdex PTAL

Trott pushed a commit to Trott/io.js that referenced this pull request Apr 26, 2019
When an invalid TLS method name error is thrown, include the invalid
name in the error message.

PR-URL: nodejs#27390
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@sam-github
Copy link
Contributor Author

Landed in 86b4f37

@sam-github sam-github closed this Apr 26, 2019
@sam-github sam-github deleted the invalid-method-name-in-error branch April 26, 2019 17:40
targos pushed a commit that referenced this pull request Apr 27, 2019
When an invalid TLS method name error is thrown, include the invalid
name in the error message.

PR-URL: #27390
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants