FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tls: accept SecureContext object in server.addContext() by HinataKah0 · Pull Request #47570 · nodejs/node · GitHub

/ node Public

tls: accept SecureContext object in server.addContext() - #47570

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
HinataKah0:tls-secure-context
Apr 26, 2023
Merged

tls: accept SecureContext object in server.addContext()#47570
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
HinataKah0:tls-secure-context

Conversation

Copy link
Copy Markdown
Contributor

Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext.

Fixes: #47408

nodejs-github-bot added needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem. labels Apr 15, 2023
anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 15, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 15, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor Author

Failing test: tools/test.py test/parallel/test-child-process-exec-stdout-stderr-data-string.js

It looks like a flaky test (doesn't seem to be related to the PR and tried running locally)
Shall we re-run?

Comment thread test/parallel/test-tls-add-context.js Outdated
Do not call tls.createSecureContext() if the context provided
is already an instance of tls.SecureContext.

Fixes: nodejs#47408
Comment thread lib/_tls_wrap.js
[re, tls.createSecureContext(context).context]);

const secureContext =
context instanceof common.SecureContext ? context : tls.createSecureContext(context);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Might be worth implementing a more efficient isSecureContext(...) method under util/types

HinataKah0 Apr 18, 2023
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't think this function is in hot path (there are limited number of subdomains & certs), so might not be worth the perf improvement vs code growth in primordials. Not too sure, CMIIW.

Copy link
Copy Markdown
Contributor Author

BTW, I can't add the labels myself. So I can't add request-ci and other labels necessary to have it merged. :)

Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 23, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 23, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 26, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 26, 2023
nodejs-github-bot merged commit b54504c into nodejs:main Apr 26, 2023

Copy link
Copy Markdown
Collaborator

Landed in b54504c

targos pushed a commit that referenced this pull request May 2, 2023
Do not call tls.createSecureContext() if the context provided
is already an instance of tls.SecureContext.

Fixes: #47408
PR-URL: #47570
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos mentioned this pull request May 2, 2023
HinataKah0 deleted the tls-secure-context branch May 14, 2023 09:33
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
Do not call tls.createSecureContext() if the context provided
is already an instance of tls.SecureContext.

Fixes: #47408
PR-URL: #47570
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
Do not call tls.createSecureContext() if the context provided
is already an instance of tls.SecureContext.

Fixes: nodejs#47408
PR-URL: nodejs#47570
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tls.SecureContext documentation contradictions

7 participants


Back | FazBrowse Home | New Git URL