autocert

5.0.0 • Public • Published

autocert

Get a TLS options object that will automagically certify your domains.

Why

Obligatory Let's Encrypt thingy.

How

acme-client

Example

var http = require('http')
var https = require('https')
var autocert = require('./')

var challenges = {}

http.createServer((req, res) => {
  var proof = challenges[req.url]
  if (proof) {
    res.end(proof)
  } else {
    res.statusCode = 404
    res.end('not found')
  }
}).listen(80)

https.createServer(autocert.tlsOpts({
  email: 'info@example.com',
  challenges,
}), (req, res) => {
  res.end('secure af')
}).listen(443)

License

MIT

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i autocert

    Weekly Downloads

    8

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    5.65 kB

    Total Files

    4

    Last publish

    Collaborators

    • jessetane