Function downloadCert

  • Get a TLS certificate by hostname. This function will always connect to port 443.

    Parameters

    • hostname: string

      Hostname to connect to (e.g. 'github.com') - not an URL

    • timeout: number = 6000

      Timeout in milliseconds (default: 6000)

    Returns Promise<Buffer>

    Buffer containing the raw certificate (DER)

    AbortError if the request timed out