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

tls: make deprecated tls.createSecurePair() use public API by addaleax · Pull Request #17882 · nodejs/node · GitHub

/ node Public

tls: make deprecated tls.createSecurePair() use public API - #17882

Closed
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:tls-remove-legacy
Closed

tls: make deprecated tls.createSecurePair() use public API#17882
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:tls-remove-legacy

Conversation

Copy link
Copy Markdown
Member

Make the deprecated tls.createSecurePair() method use other public
APIs only (TLSSocket in particular).

Since tls.createSecurePair() has been runtime-deprecated only
since Node 8, it probably isn’t quite time to remove it yet,
but this patch removes almost all of the code complexity that
is retained by it.

The API, as it is documented, is retained. However, it is very likely
that some users have come to rely on parts of undocumented API
of the SecurePair class, especially since some of the existing
tests checked for those. Therefore, this should definitely be
considered a breaking change.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

tls

addaleax added semver-major PRs that contain breaking changes and should be released in the next major version. tls Issues and PRs related to the tls subsystem. labels Dec 27, 2017
nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Dec 27, 2017

addaleax commented Dec 27, 2017
edited
Loading

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-commit/15097/
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1176/
(both good)

I’m very open to just not considering this a good idea.

bnoordhuis left a comment

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

Nice! And that DuplexPair class is clever.

it is very likely that some users have come to rely on parts of undocumented API of the SecurePair class

Do you mean ._external? I have no problem with breaking that, that's always been an ill-considered hack.

Comment thread src/node_crypto.cc Outdated

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

You can remove sent_shutdown_string, received_shutdown_string and onnewsessiondone_string from env.h, this is the only place they're used.

Comment thread src/node_crypto.cc Outdated

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

onselect_string can be removed too.

Copy link
Copy Markdown
Member Author

@bnoordhuis Thanks! I removed the unused strings here.

Nice! And that DuplexPair class is clever.

It’s from our test suite. :) I’ll think about maybe making it a public API in a follow-up PR, it seems like a useful primitive to me.

it is very likely that some users have come to rely on parts of undocumented API of the SecurePair class

Do you mean ._external? I have no problem with breaking that, that's always been an ill-considered hack.

At least one of the removed tests here used e.g. pair.ssl.setSNICallback. Also, there’s no real reason not to consider this semver-major, right? :)

BridgeAR left a comment

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

I think this is fantastic. As I don't do a full code review: rubberstamp LGTM.

Copy link
Copy Markdown
Contributor

Hmmm, I'm a little bit concerned about user breakage here. Since the function is deprecated and (fingers crossed?) can be removed in Node 10, is it worth it to rewrite the function if all of the deprecated code can "just" be removed soon-ish? Also, the irony of making a semver-major change on a deprecated function isn't lost on me yet 😄

Copy link
Copy Markdown
Member Author

@maclover7 The thing is, this PR brings us into a position where we don’t have an incentive to remove this feature that early, because its maintenance cost is reduced by 95 % (or at least that’s what the diff size says).

And since stability is good for Node core & I think that means we should always take our time with removing/deprecating features, this PR allows us to do exactly that.

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jan 2, 2018
Make the deprecated `tls.createSecurePair()` method use other public
APIs only (`TLSSocket` in particular).

Since `tls.createSecurePair()` has been runtime-deprecated only
since Node 8, it probably isn’t quite time to remove it yet,
but this patch removes almost all of the code complexity that
is retained by it.

The API, as it is documented, is retained. However, it is very likely
that some users have come to rely on parts of undocumented API
of the `SecurePair` class, especially since some of the existing
tests checked for those. Therefore, this should definitely be
considered a breaking change.

TimothyGu left a comment

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

The code reduction is too good to pass up.

addaleax removed lib / src Issues and PRs related to general changes in the lib or src directory. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. labels Jan 14, 2018

Copy link
Copy Markdown
Member Author

Landed in 9301b8a

addaleax closed this Jan 14, 2018
addaleax deleted the tls-remove-legacy branch January 14, 2018 13:54
addaleax added a commit that referenced this pull request Jan 14, 2018
Make the deprecated `tls.createSecurePair()` method use other public
APIs only (`TLSSocket` in particular).

Since `tls.createSecurePair()` has been runtime-deprecated only
since Node 8, it probably isn’t quite time to remove it yet,
but this patch removes almost all of the code complexity that
is retained by it.

The API, as it is documented, is retained. However, it is very likely
that some users have come to rely on parts of undocumented API
of the `SecurePair` class, especially since some of the existing
tests checked for those. Therefore, this should definitely be
considered a breaking change.

PR-URL: #17882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>

Copy link
Copy Markdown
Member

I think it is fine but this landed with only one @nodejs/tsc member giving a LG.

Copy link
Copy Markdown
Member Author

Oh, right, thanks for catching … I kinda still had it in my mind that @bnoordhuis was one of the TSC people. Want me to rebase it out of master?

Copy link
Copy Markdown
Member

No, as I said: I personally think it is fine and I know that it is sometimes difficult to get enough people having a look.

Copy link
Copy Markdown
Member

LGTM after the fact

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

semver-major PRs that contain breaking changes and should be released in the next major version. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL