This commit is contained in:
AJ ONeal 2016-08-05 18:21:10 -04:00
parent 63b9cb5ec9
commit a654891cfa
2 changed files with 33 additions and 31 deletions

View File

@ -154,31 +154,30 @@ le.exists({ domain: 'example.com' }).then(function (results) {
return;
}
// Register Certificate manually
le.register(
{ domains: ['example.com'] // CHANGE TO YOUR DOMAIN (list for SANS)
// Register Certificate manually
le.register({
domains: ['example.com'] // CHANGE TO YOUR DOMAIN (list for SANS)
, email: 'user@email.com' // CHANGE TO YOUR EMAIL
, agreeTos: '' // set to tosUrl string to pre-approve (and skip agreeToTerms)
, rsaKeySize: 2048 // 1024 or 2048
, rsaKeySize: 2048 // 2048 or higher
, challengeType: 'http-01' // http-01, tls-sni-01, or dns-01
}
, function (err, results) {
if (err) {
}).then(function (results) {
console.log('success');
}, function (err) {
// Note: you must either use le.middleware() with express,
// manually use le.getChallenge(domain, key, val, done)
// or have a webserver running and responding
// to /.well-known/acme-challenge at `webrootPath`
console.error('[Error]: node-letsencrypt/examples/standalone');
console.error(err.stack);
return;
}
console.log('success');
}
);
});
});
```
@ -241,7 +240,7 @@ TODO double check and finish
* accounts.get
* accounts.exists
* certs
* certs.byDomain
* certs.byAccount
* certs.all
* certs.get
* certs.exists
@ -250,9 +249,9 @@ TODO double check and finish
TODO finish
* setChallenge(opts, domain, key, value, done); // opts will be saved with domain/key
* getChallenge(domain, key, done); // opts will be retrieved by domain/key
* removeChallenge(domain, key, done); // opts will be retrieved by domain/key
* `.set(opts, domain, key, value, done);` // opts will be saved with domain/key
* `.get(opts, domain, key, done);` // opts will be retrieved by domain/key
* `.remove(opts, domain, key, done);` // opts will be retrieved by domain/key
Change History
==============

View File

@ -1,20 +1,17 @@
'use strict';
// TODO handle www and no-www together somehow?
var PromiseA = require('bluebird');
var leCore = require('letiny-core');
var LE = module.exports;
LE.defaults = {
server: leCore.productionServerUrl
, stagingServer: leCore.stagingServerUrl
, liveServer: leCore.productionServerUrl
, productionServerUrl: leCore.productionServerUrl
productionServerUrl: leCore.productionServerUrl
, stagingServerUrl: leCore.stagingServerUrl
, rsaKeySize: leCore.rsaKeySize || 2048
, challengeType: leCore.challengeType || 'http-01'
, acmeChallengePrefix: leCore.acmeChallengePrefix
};
@ -23,6 +20,7 @@ Object.keys(LE.defaults).forEach(function (key) {
LE[key] = LE.defaults[key];
});
// show all possible options
var u; // undefined
LE._undefined = {
store: u
@ -32,6 +30,9 @@ LE._undefined = {
, renewWithin: u
, memorizeFor: u
, acmeChallengePrefix: u
, rsaKeySize: u
, challengeType: u
, server: u
};
LE._undefine = function (le) {
Object.keys(LE._undefined).forEach(function (key) {
@ -49,6 +50,8 @@ LE.create = function (le) {
var core = le.core = require('./lib/core');
le.acmeChallengePrefix = LE.acmeChallengePrefix;
le.rsaKeySize = le.rsaKeySize || LE.rsaKeySize;
le.challengeType = le.challengeType || LE.challengeType;
if (!le.renewWithin) { le.renewWithin = 3 * 24 * 60 * 60 * 1000; }
if (!le.memorizeFor) { le.memorizeFor = 1 * 24 * 60 * 60 * 1000; }