@ -1,21 +1,8 @@
<!-- BANNER_TPL_BEGIN -->
About Daplie: We're taking back the Internet!
--------------
Down with Google, Apple, and Facebook!
We're re-decentralizing the web and making it read-write again - one home cloud system at a time.
Tired of serving the Empire? Come join the Rebel Alliance:
< a href = "mailto:jobs@daplie.com" > jobs@daplie.com</ a > | [Invest in Daplie on Wefunder ](https://daplie.com/invest/ ) | [Pre-order Cloud ](https://daplie.com/preorder/ ), The World's First Home Server for Everyone
<!-- BANNER_TPL_END -->
le-sni-auto
===========
| Sponsored by [ppl ](https://ppl.family )
An auto-sni strategy for registering and renewing letsencrypt certificates using SNICallback.
This does a couple of rather simple things:
@ -77,7 +64,7 @@ http.createServer(le.middleware(redirectHttps));
var app = require('express')();
https.createServer(le.http sOptions, le.middleware(app)).listen(443);
https.createServer(le.tl sOptions, le.middleware(app)).listen(443);
```
You can also provide a thunk-style `getCertificates(domain, certs, cb)` .
@ -107,11 +94,11 @@ var leSni = require('le-sni-auto').create({
// some default certificates that work with localhost
// (because default certificates are required as a fallback)
var httpsOptions = require('localhost.daplie.com -certificates').merge({
var tlsOptions = require('localhost.daplie.me -certificates').merge({
SNICallback: leSni.sniCallback
});
https.createServer(http sOptions, app);
https.createServer(tl sOptions, app);
```
You can also provide a thunk-style `getCertificates(domain, certs, cb)` .
@ -154,14 +141,14 @@ You would set this to `10 * 24 * 60 * 60 * 1000`.
.sniCallback()
-----------
This gets passed to `https.createServer(httpsOptions, app)` as `http sOptions.SNICallback` .
This gets passed to `https.createServer(tlsOptions, app)` as `tl sOptions.SNICallback` .
```javascript
var leSni = require('le-sni-auto').create({
renewWithin: 10 * 24 * 60 * 60 1000
});
var http sOptions = require('localhost.daplie.com-certificates').merge({
var tl sOptions = require('localhost.daplie.com-certificates').merge({
SNICallback: leSni.sniCallback
});
@ -169,7 +156,7 @@ function app(req, res) {
res.end("Hello, World!");
}
https.createServer(http sOptions, app);
https.createServer(tl sOptions, app);
```
.cacheCerts()