From af425744198898a1447bc71854717e508cf913dd Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 16 Dec 2015 01:33:05 +0000 Subject: [PATCH] updates --- README.md | 9 +++++++++ example/challenge-store.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 example/challenge-store.js diff --git a/README.md b/README.md index f5b6ae2..83ba1ae 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,15 @@ A framework for building letsencrypt clients, forked from `letiny`. * browser WebCrypto (not implemented, but on the TODO) * any javascript implementation +### These aren't the droids you're looking for + +This is a library / framework for building letsencrypt clients. +You probably want one of these pre-built clients instead: + + * `letsencrypt` (100% compatible with the official client) + * `letiny` (lightweight client) + * `letsencrypt-express` (automatic https for express) + ## Usage: ```bash diff --git a/example/challenge-store.js b/example/challenge-store.js new file mode 100644 index 0000000..cae50e0 --- /dev/null +++ b/example/challenge-store.js @@ -0,0 +1,30 @@ +// Finally, you need an implementation of `challengeStore`: + +'use strict'; + +// Note: +// key is the xxxx part of `/.well-known/acme-challenge/xxxx` +// value is what is needs to be return the the requesting server +// +// it is very common to store this is a directory as a file +// (and you can totally do that if you want to, no big deal) +// but that's super inefficient considering that you need it +// for all of 500ms and there's no sense in that. + + +var challengeCache = {}; +var challengeStore = { + set: function (hostname, key, value, cb) { + challengeCache[key] = value; + cb(null); + } +, get: function (hostname, key, cb) { + cb(null, challengeCache[key]); + } +, remove: function (hostname, key, cb) { + delete challengeCache[key]; + cb(null); + } +}; + +module.exports = challengeStore;