Skip to content

tls documentation says that checkServerIdentity function should throw an error. It should not. #11467

Description

@lockhart-raphael
  • Version: 6.7.0 - 7.5.0 (at least)
  • Platform: All? tested on MacOS / Linux
  • Subsystem: TLS

The documentation for the checkServerIdentity function at https://nodejs.org/api/tls.html#tls_tls_connect_options_callback
states that the provided function "should throw an error if verification fails. "

However, the implementation (https://github.com/nodejs/node/blob/master/lib/_tls_wrap.js#L1083) expects a truthy value returned from the function as the error, and has no try / catch logic to catch an error if thrown, with the result that if the checkServerIdentity function throws an error the whole process will likely exit. Either the docs or the implementation should be corrected to reflect the intended behavior.

Activity

  1. added
    tlsIssues and PRs related to the tls subsystem.
    docIssues and PRs related to Node.js documentation.
    on Feb 20, 2017
  2. sam-github commented on Feb 20, 2017

    @sam-github
    Contributor

    fixed in #10846, but no one spoke up for it

    I'll try to factor pieces of those docs out and get them accepted

  3. Trott commented on Jul 26, 2017

    @Trott
    Member

    @sam-github Should this remain open?

  4. sam-github commented on Jul 26, 2017

    @sam-github
    Contributor

    yes, the docs are wrong

  5. apapirovski commented on Apr 13, 2018

    @apapirovski
    Contributor

    Fixed by #17203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions