JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 803
  • Score
    100M100P100Q103842F
  • License ISC

Generate a self-signed TLS certificate and add it to the trusted certificate store.

Package Exports

  • tls-keygen

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tls-keygen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tls-keygen

Generate a self-signed TLS certificate and add it to the trusted certificate store.

CLI

npx tls-keygen "key.pem" "cert.pem"

Where key.pem and cert.pem are the output destination filepaths for the TLS private key and public certificate respectively.

API

const {setupTLS} = require('tls-keygen')
setupTLS({
  // Default: ./key.pem
  key: '/path/to/output/key.pem',

  // Default: ./cert.pem
  cert: '/path/to/output/cert.pem',

  // Default: localhost
  commonName = 'example.net',

  // Default: [
  //   'DNS:localhost',
  //   'DNS:*.localhost',
  //   'IP:127.0.0.1',
  //   'IP:0.0.0.0',
  //   'IP:::1'
  // ]
  subjectAltName: ['DNS:www.example.net', 'DNS:mail.example.net']
})

Platform Support

  • MacOS
  • Linux