letsencrypt-lambdadeprecated

this module is a mini version of [Deplie](https://github.com/Daplie)'s [greenlock](https://www.npmjs.com/package/greenlock) the goal is to be able to request certificate from ACME using AWS Lambda it is work in progress, may not work as expected, it

Usage no npm install needed!

<script type="module">
  import letsencryptLambda from 'https://cdn.skypack.dev/letsencrypt-lambda';
</script>

README

letsencrypt-lambda

this module is a mini version of Deplie's greenlock
the goal is to be able to request certificate from ACME using AWS Lambda
it is work in progress, may not work as expected, it generate a new private key with every request
it does not require node-gyp
it generates RSA keypairs using plain javascript and may take 10s+ to finish
should not be used directly with AWS API Gateway as it will probably time out

npm install letsencrypt-lambda
var cr = require("letsencrypt-lambda")
cr.request({
    domain: 'www.mydomain.com', 
    email : 'admin@mydomain.com',
    staging: true, // use dev server while testing, use live server when you're ready
    token: function( domain, token, secret , cb) {
        console.log("got token", token)
    
        // ACME will give you a TOKEN+SECRET and then call
        // http://www.mydomain.com/.well-known/acme-challenge/TOKEN
        // make sure you reply with status 200 and SECRET as request body content
        redis.set('acme_'+token, secret)
        redis.expire('acme_'+token, 60*60)
        cb(null);
    }
})
.then(function(keypair) {
  console.log(keypair)
})