diff --git a/example/letsencrypt.js b/example/letsencrypt.js index 63a97f6..45a4fb6 100644 --- a/example/letsencrypt.js +++ b/example/letsencrypt.js @@ -1,13 +1,14 @@ 'use strict'; -var LeCore = require('letiny-core'); +//var LeCore = require('letiny-core'); +var LeCore = require('../'); var email = process.argv[2] || 'user@example.com'; // CHANGE TO YOUR EMAIL var domains = [process.argv[3] || 'example.com']; // CHANGE TO YOUR DOMAIN var acmeDiscoveryUrl = LeCore.stagingServerUrl; var challengeStore = require('./challenge-store'); -var certStore = require('cert-store'); +var certStore = require('./cert-store'); var serve = require('./serve'); var accountPrivateKeyPem = null; @@ -34,10 +35,10 @@ function init() { } function getPrivateKeys() { - LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (pems) { + LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) { accountPrivateKeyPem = pems.privateKeyPem; - LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (pems) { + LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) { domainPrivateKeyPem = pems.privateKeyPem; diff --git a/lib/node.js b/lib/node.js index d393f34..fe8ad1e 100644 --- a/lib/node.js +++ b/lib/node.js @@ -6,7 +6,7 @@ 'use strict'; var request = require('request'); -var leUtils = require('./acme-utils'); +var leUtils = require('./acme-util'); var leCrypto = require('./letsencrypt-node-crypto'); var leForge = require('./letsencrypt-forge'); var leUrsa; diff --git a/node.js b/node.js index 150b2f0..fb81c94 100644 --- a/node.js +++ b/node.js @@ -13,6 +13,16 @@ function create(deps) { LeCore.registerNewAccount = require('./lib/register-new-account').create(deps); LeCore.getCertificate = require('./lib/get-certificate').create(deps); + // Note: these are NOT DEFAULTS + // They are de facto standards that you may + // or may not use in your implementation + LeCore.productionServerUrl = "https://acme-v01.api.letsencrypt.org/directory"; + LeCore.stagingServerUrl = "https://acme-staging.api.letsencrypt.org/directory"; + LeCore.acmeChallengePrefix = "/.well-known/acme-challenge/"; + LeCore.configDir = "/etc/letsencrypt/"; + LeCore.logsDir = "/var/log/letsencrypt/"; + LeCore.workDir = "/var/lib/letsencrypt/"; + return LeCore; }