From 48db1620ad0fc679d2fa64845d568b668e24dab4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 10 Dec 2015 21:30:54 -0800 Subject: [PATCH] fix serve-chain bug --- serve.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/serve.js b/serve.js index 86c70ba..cc8613e 100755 --- a/serve.js +++ b/serve.js @@ -93,7 +93,7 @@ function run() { if (letsencryptHost) { argv.key = argv.key || '/etc/letsencrypt/live/' + letsencryptHost + '/privkey.pem'; argv.cert = argv.cert || '/etc/letsencrypt/live/' + letsencryptHost + '/fullchain.pem'; - argv.root = argv.root || argv.chain || '/etc/letsencrypt/live/' + letsencryptHost + '/root.pem'; + argv.root = argv.root || argv.chain || ''; argv.servername = argv.servername || letsencryptHost; argv['serve-root'] = argv['serve-root'] || argv['serve-chain']; } @@ -131,16 +131,16 @@ function run() { })); }, []); - if (argv['serve-root']) { - content = opts.ca.join('\r\n'); - } - // TODO * `--verify /path/to/root.pem` require peers to present certificates from said authority if (argv.verify) { opts.ca = peerCa; opts.requestCert = true; opts.rejectUnauthorized = true; } + + if (argv['serve-root']) { + content = peerCa.join('\r\n'); + } } opts.servername = 'localhost.daplie.com';