这个提交包含在:
AJ ONeal 2015-12-17 09:14:33 +00:00
父节点 3582b59bd2
当前提交 2b2c9a2081
共有 2 个文件被更改,包括 31 次插入6 次删除

查看文件

@ -58,6 +58,12 @@ cli.main(function(_, options) {
args.domains = args.domains.split(',');
}
if (!(Array.isArray(args.domains) && args.domains.length) || !args.email || !args.agreeTos) {
console.error("\nUsage: letsencrypt certonly --standalone --domains example.com --email user@example.com --agree-tos");
console.error("\nSee letsencrypt --help for more details\n");
return;
}
if (args.tlsSni01Port) {
args.tlsSni01Port = args.tlsSni01Port.split(',').map(function (port) {
return parseInt(port, 10);
@ -89,7 +95,15 @@ cli.main(function(_, options) {
}
// let LE know that we're handling standalone / webroot here
LE.create({ manual: true }, handlers).register(args, function (err, results) {
LE.create({
manual: true
, debug: args.debug
, configDir: args.configDir
, privkeyPath: ':conf/live/:hostname/privkey.pem' //args.privkeyPath
, fullchainPath: args.fullchainPath
, certPath: args.certPath
, chainPath: args.chainPath
}, handlers).register(args, function (err, results) {
if (err) {
console.error('[Error]: letsencrypt');
console.error(err);
@ -101,8 +115,14 @@ cli.main(function(_, options) {
}
// should get back account, path to certs, pems, etc?
console.log('results');
console.log(results);
console.log('\nCertificates installed at:');
console.log(Object.keys(results).filter(function (key) {
return /Path/.test(key);
}).map(function (key) {
return results[key];
}).join('\n'));
process.exit(0);
});
});
});

查看文件

@ -38,7 +38,8 @@ module.exports.create = function () {
res.end(val || '_');
});
}
, startServers: function (plainPorts, tlsPorts) {
, startServers: function (plainPorts, tlsPorts, opts) {
opts = opts || {};
var httpsOptions = require('localhost.daplie.com-certificates');
var https = require('https');
var http = require('http');
@ -50,12 +51,16 @@ module.exports.create = function () {
plainPorts.forEach(function (port) {
http.createServer(handlers.httpResponder).listen(port, function () {
console.info('Listening http on', this.address());
if (opts.debug) {
console.info('Listening http on', this.address());
}
});
});
tlsPorts.forEach(function (port) {
https.createServer(httpsOptions, handlers.httpResponder).listen(port, function () {
console.info('Listening https on', this.address());
if (opts.debug) {
console.info('Listening https on', this.address());
}
});
});
}