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

src: refactor TLSWrap #35552

Closed
wants to merge 1 commit into from
Closed

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Oct 8, 2020

This accomplishes a couple of things...

  • Previously, TLSWrap and SSLWrap were defined separately, with SSLWrap as an abstract template class presumably with the intent of allowing it to be reused in other ways that never actually happened. Here they are collapsed and SSLWrap is eliminated entirely

  • Updates and modernizes the code inside TLSWrap

While this is semver-patch, it depends on the currently semver-major #35093

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Oct 8, 2020
@jasnell jasnell added crypto Issues and PRs related to the crypto subsystem. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 10, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 10, 2020
@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member Author

jasnell commented Oct 10, 2020

Heh, some definite failures in CI ;-) ... moving this back to draft until I can take a look

@jasnell jasnell marked this pull request as draft October 10, 2020 17:50
@mildsunrise
Copy link
Member

thank you! I was going to open a PR for this same thing

@jasnell
Copy link
Member Author

jasnell commented Oct 12, 2020

Awesome. It's almost done. Have to trace down a couple of failing tests that aren't exactly obvious with regards to why they're failing but it's close

SSLWrap was needlessly defined as a template class, splitting the
TLS implementation over multiple locations. The original idea, I
surmise, was to make it possible to reuse SSLWrap for some other
purpose that never manifest. This squashes them down into a single
TLSWrap class and moves tls_wrap.h/cc into src/crypto.

Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell jasnell marked this pull request as ready for review October 12, 2020 15:21
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 12, 2020
@jasnell
Copy link
Member Author

jasnell commented Oct 12, 2020

@mildsunrise (and others) this should be good to go now :-)

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 12, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@jasnell
Copy link
Member Author

jasnell commented Oct 13, 2020

Dealing with some seemingly unrelated CI failures on this. Running CI again to see what happens

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 15, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 15, 2020
@nodejs-github-bot

This comment has been minimized.

@mildsunrise
Copy link
Member

will this be backported? I initially assumed so, but it depends on a semver-major change, so 🤔

@mildsunrise
Copy link
Member

mildsunrise commented Oct 15, 2020

also, context for newer contributors who arrive here: SSLWrap was previously used as a common base for SecurePair (the old TLS API) and TLSWrap (the current tls.Socket API) IIRC. We completely removed SecurePair a while ago (it's now an emulation layer on top of tls.Socket), so it no longer makes sense to keep both classes.

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. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants