Skip to content

API docs: type for TLS Certificate's subjectaltname field is wrong. #27721

Description

@cakoose

The API doc says it's an array (link):

  • subjectaltname <Array> (Optional) An array of names for the subject, an alternative to the subject names.

But there's an example below those docs that shows a string:

subjectaltname: 'DNS:*.nodejs.org, DNS:nodejs.org',

When I use TlsSocket.getPeerCertificate() myself, I get a string.

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    good first issueIssues that are suitable for first-time contributors.
    tlsIssues and PRs related to the tls subsystem.
    on May 16, 2019
  2. danbeglin commented on May 16, 2019

    @danbeglin
    Contributor

    I'll put a PR in this evening to fix this.

    I'll double check that TlsSocket.getPeerCertificate() does return a string as @cakoose says, and update the docs accordingly

  3. cakoose commented on May 16, 2019

    @cakoose
    Author

    Steps you can use to check getPeerCertificate():

    get-peer-certificate.js

    const https = require('https');
    https.get('https://httpbin.org/get', res => {
        console.log('getPeerCertificate', res.socket.getPeerCertificate());
    });
    
    $ node get-peer-certificate.js
    ...
      subjectaltname: 'DNS:httpbin.org, DNS:*.httpbin.org',
    ...
    
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.good first issueIssues that are suitable for first-time contributors.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