fastify-tls-keygen

1.1.0 • Public • Published

fastify-tls-keygen

Fastify plugin to automatically generate a browser-compatible, trusted, self-signed, localhost-only, TLS certificate.

Chrome Safari Edge Firefox
MacOS
Windows
Linux

Installation

npm install fastify-tls-keygen

Usage

const fastify = require('fastify')({
  // Required: Enable TLS
  https: true,
  // Optional: Enable HTTP/2
  http2: true
})
 
fastify.register(require('fastify-tls-keygen'), {
  // Optional (default: ./key.pem)
  key: '/path/to/save/private/key.pem',
  // Optional (default: ./cert.pem)
  cert: '/path/to/save/public/certificate.pem'
})
 
// Tip: Port 443 (HTTPS) requires root permissions. Use a port >1024.
fastify.listen(8443)

See Also

Colophon

Made with 💝 by Sebastiaan Deckers in 🇸🇬 Singapore.

Package Sidebar

Install

npm i fastify-tls-keygen

Weekly Downloads

91

Version

1.1.0

License

ISC

Unpacked Size

3.38 kB

Total Files

4

Last publish

Collaborators

  • seb