simplify STOP

This commit is contained in:
AJ ONeal 2016-08-05 03:20:19 -04:00
parent 805f7903f7
commit 2d647e7349
1 changed files with 30 additions and 39 deletions

View File

@ -28,35 +28,21 @@ Automatic [Let's Encrypt](https://letsencrypt.org) HTTPS / TLS / SSL Certificate
STOP STOP
==== ====
**These aren't the droids you're looking for.** > **These aren't the droids you're looking for.**
This is a **low-level library** for implementing ACME / LetsEncrypt Clients, CLIs, This is a **low-level library** for implementing ACME / LetsEncrypt Clients, CLIs,
system tools, and abstracting storage backends (file vs db, etc). system tools, and abstracting storage backends (file vs db, etc).
This is not the thing to use in your webserver directly. For `express`, raw `https` or `spdy`, or `restify` (same as raw https) see
[**letsencrypt-express**](https://github.com/Daplie/letsencrypt-express).
### Use [letsencrypt-express](https://github.com/Daplie/letsencrypt-express) if... For `hapi` see [letsencrypt-hapi](https://github.com/Daplie/letsencrypt-hapi).
you are planning to use one of these: For `koa` or `rill`
see [letsencrypt-koa](https://github.com/Daplie/letsencrypt-koa).
* `express` For `bash`, `fish`, `zsh`, `cmd.exe`, `PowerShell`
* `connect` see [**letsencrypt-cli**](https://github.com/Daplie/letsencrypt-cli).
* raw `https`
* raw `spdy`
* `restify` (same as raw https)
* `hapi` See [letsencrypt-hapi](https://github.com/Daplie/letsencrypt-hapi)
* `koa` See [letsencrypt-koa](https://github.com/Daplie/letsencrypt-koa)
* `rill` (similar to koa example)
### Use [letsencrypt-cli](https://github.com/Daplie/letsencrypt-cli) if...
You are planning to use one of these:
* `bash`
* `fish`
* `zsh`
* `cmd.exe`
* `PowerShell`
CONTINUE CONTINUE
======== ========
@ -66,6 +52,12 @@ If you're sure you're at the right place, here's what you need to know now:
Install Install
------- -------
`letsencrypt` requires at least two plugins:
one for managing certificate storage and the other for handling ACME challenges.
The default storage plugin is [`le-store-certbot`](https://github.com/Daplie/le-store-certbot)
and the default challenger is [`le-challenge-fs`](https://github.com/Daplie/le-challenge-fs).
```bash ```bash
npm install --save letsencrypt@2.x npm install --save letsencrypt@2.x
npm install --save le-store-certbot@2.x npm install --save le-store-certbot@2.x
@ -83,28 +75,27 @@ Against my better judgement I'm providing a terribly oversimplified exmaple
of how to use this library: of how to use this library:
```javascript ```javascript
var app = express();
var le = require('letsencrypt').create({ server: 'staging' }); var le = require('letsencrypt').create({ server: 'staging' });
app.use('/', le.middleware()); le.register(
{ domains: ['example.com'], email: 'user@email.com', agreeTos: true }
var reg = { , function (err, results) {
domains: ['example.com'] console.log(err, results);
, email: 'user@email.com'
, agreeTos: true
};
le.register(reg, function (err, results) {
if (err) {
console.error(err.stack);
return;
} }
);
console.log(results);
});
``` ```
You also need some sort of server to handle the acme challenge:
```
var app = express();
app.use('/', le.middleware());
```
Note: The `webrootPath` string is a template.
Any occurance of `:hostname` will be replaced
with the domain for which we are requested certificates.
### Useful Example ### Useful Example
The configuration consists of 3 components: The configuration consists of 3 components: