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

doc: Improve checkServerIdentity docs #17203

Closed

Conversation

Hannes-Magnusson-CK
Copy link
Contributor

Checklist
Affected core subsystem(s)

tls doc

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem. labels Nov 21, 2017
@Hannes-Magnusson-CK
Copy link
Contributor Author

See also #11467

Trott
Trott previously requested changes Nov 22, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Seems good to me with one requested change. Thanks for the pull request!

doc/api/tls.md Outdated
@@ -792,8 +792,9 @@ changes:
* `servername`: {string} Server name for the SNI (Server Name Indication) TLS
extension.
* `checkServerIdentity(servername, cert)` {Function} A callback function
to be used when checking the server's hostname against the certificate.
This should throw an error if verification fails. The method should return
to be used (instead of the builtin {tls.checkServerIdentity} function)
Copy link
Member

Choose a reason for hiding this comment

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

Can you please change this line to this?:

to be used instead of tls.checkServerIdentity()

Backticks are appropriate here. Curly braces are for types. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh. That makes sense. Thanks for the comment!
Fixed :)

doc/api/tls.md Outdated
@@ -792,8 +792,9 @@ changes:
* `servername`: {string} Server name for the SNI (Server Name Indication) TLS
extension.
* `checkServerIdentity(servername, cert)` {Function} A callback function
to be used when checking the server's hostname against the certificate.
This should throw an error if verification fails. The method should return
   to be used (instead of the builtin `tls.checkServerIdentity` function)
Copy link
Member

Choose a reason for hiding this comment

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

Tiny nit: can you use tls.checkServerIdentity()? It seems to be the dominant style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

of course! :) Updated

@Hannes-Magnusson-CK
Copy link
Contributor Author

Probably a dumb question, I'm new around here =):
The "Public API" comment in https://github.com/nodejs/node/blob/master/lib/tls.js#L239

What makes those export more public then say https://github.com/nodejs/node/blob/master/lib/tls.js#L168 ?

If thats purely source code readability, should I document the checkServerIdentity function?

@bnoordhuis
Copy link
Member

@Hannes-Magnusson-CK The comment is a bit misguided / misleading, it should just be removed.

You could read it as "these are the public and documented APIs" but some of the exports elsewhere are mentioned in the docs too, if only in passing.

@Hannes-Magnusson-CK
Copy link
Contributor Author

Ok. Thanks @bnoordhuis !
I'll see if I can create another PR for documenting the checkServerIdentity function, removing the comment, and maybe couple of other related things.

@Hannes-Magnusson-CK
Copy link
Contributor Author

Hannes-Magnusson-CK commented Nov 22, 2017

Added a commit documenting tls.checkServerIdentity to this PR :)

@@ -236,7 +236,6 @@ exports.parseCertString = internalUtil.deprecate(
'Please use querystring.parse() instead.',
'DEP0076');

// Public API
Copy link
Member

Choose a reason for hiding this comment

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

why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its a misleading comment. These aren't the only exported functions.

@Trott Trott dismissed their stale review November 24, 2017 22:01

requested change was made

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 30, 2017
@addaleax
Copy link
Member

addaleax commented Dec 1, 2017

Landed in da429c3, df63e53

Thanks for the PR! 🎉 ✨

@addaleax addaleax closed this Dec 1, 2017
addaleax pushed a commit that referenced this pull request Dec 1, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
addaleax pushed a commit that referenced this pull request Dec 1, 2017
The funciton was added in eb2ca10

PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 1, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
The funciton was added in eb2ca10

PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
The funciton was added in eb2ca10

PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
The funciton was added in eb2ca10

PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@gibfahn
Copy link
Member

gibfahn commented Dec 19, 2017

Backported da429c3 to v6.x, df63e53 had conflicts, so choosing to leave it.

@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
The funciton was added in eb2ca10

PR-URL: #17203
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants