Skip to content

Get a TLS options object that will automagically certify your domains

Notifications You must be signed in to change notification settings

jessetane/autocert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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: '[email protected]',
  challenges,
}), (req, res) => {
  res.end('secure af')
}).listen(443)

License

MIT

About

Get a TLS options object that will automagically certify your domains

Resources

Stars

Watchers

Forks

Packages

No packages published