1.1.0 • Published 6 years ago

fastify-tls-keygen v1.1.0

Weekly downloads
16
License
ISC
Repository
gitlab
Last release
6 years ago

fastify-tls-keygen

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

ChromeSafariEdgeFirefox
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.

1.1.0

6 years ago

1.0.0

6 years ago