From 9f5b52a7bec38a5b19cd38ec38722183f84a0662 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 16 Dec 2015 02:44:44 +0000 Subject: [PATCH] updates --- example/cert-store.js | 9 +++++++-- example/challenge-store.js | 9 +++++++-- example/letsencrypt.js | 15 +++++++++++++-- example/serve.js | 8 +++++++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/example/cert-store.js b/example/cert-store.js index 7dd568b..3d44d4c 100644 --- a/example/cert-store.js +++ b/example/cert-store.js @@ -1,8 +1,13 @@ +/*! + * letiny-core + * Copyright(c) 2015 AJ ONeal https://daplie.com + * Apache-2.0 OR MIT (and hence also MPL 2.0) +*/ +'use strict'; + // It's good to have a place to store the certificates so you can, // y'know, use them! :-) -'use strict'; - // you receive a hostname and must give back an object // with a public cert chain and a private key diff --git a/example/challenge-store.js b/example/challenge-store.js index 291ec3c..fea8a47 100644 --- a/example/challenge-store.js +++ b/example/challenge-store.js @@ -1,7 +1,12 @@ -// Finally, you need an implementation of `challengeStore`: - +/*! + * letiny-core + * Copyright(c) 2015 AJ ONeal https://daplie.com + * Apache-2.0 OR MIT (and hence also MPL 2.0) +*/ 'use strict'; +// Finally, you need an implementation of `challengeStore`: + // Note: // key is the xxxx part of `/.well-known/acme-challenge/xxxx` // value is what is needs to be return the the requesting server diff --git a/example/letsencrypt.js b/example/letsencrypt.js index 45a4fb6..6490ff1 100644 --- a/example/letsencrypt.js +++ b/example/letsencrypt.js @@ -1,3 +1,8 @@ +/*! + * letiny-core + * Copyright(c) 2015 AJ ONeal https://daplie.com + * Apache-2.0 OR MIT (and hence also MPL 2.0) +*/ 'use strict'; //var LeCore = require('letiny-core'); @@ -24,9 +29,11 @@ init(); function init() { getPrivateKeys(function () { - LeCore.getAcmeUrls(acmeDiscoveryUrl, function (urls) { + console.log('Getting Acme Urls'); + LeCore.getAcmeUrls(acmeDiscoveryUrl, function (err, urls) { // in production choose LeCore.productionServerUrl + console.log('Got Acme Urls', err, urls); acmeUrls = urls; runDemo(); @@ -35,18 +42,21 @@ function init() { } function getPrivateKeys() { + console.log('Generating Account Keypair'); LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) { accountPrivateKeyPem = pems.privateKeyPem; + console.log('Generating Domain Keypair'); LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) { domainPrivateKeyPem = pems.privateKeyPem; - + runDemo(); }); }); } function runDemo() { + console.log('Registering New Account'); LeCore.registerNewAccount( { newRegUrl: acmeUrls.newReg , email: email @@ -66,6 +76,7 @@ function runDemo() { console.log('[regr]'); console.log(regr); + console.log('Registering New Certificate'); LeCore.getCertificate( { domainPrivateKeyPem: domainPrivateKeyPem , accountPrivateKeyPem: accountPrivateKeyPem diff --git a/example/serve.js b/example/serve.js index a232144..1f75c9c 100644 --- a/example/serve.js +++ b/example/serve.js @@ -1,6 +1,12 @@ +/*! + * letiny-core + * Copyright(c) 2015 AJ ONeal https://daplie.com + * Apache-2.0 OR MIT (and hence also MPL 2.0) +*/ +'use strict'; + // That will fail unless you have a webserver running on 80 and 443 (or 5001) // to respond to `/.well-known/acme-challenge/xxxxxxxx` with the proper token -'use strict'; module.exports.init = function (deps) { var tls = require('tls');