Merge remote-tracking branch 'MaitreyaBuddha/master' into master

This commit is contained in:
tigerbot 2017-04-14 13:18:50 -06:00
commit f79c62032c
2 changed files with 12 additions and 14 deletions

View File

@ -6,7 +6,7 @@
'use strict';
//var LeCore = require('letiny-core');
var LeCore = require('../');
var LeCore = require('../').ACME.create();
var email = process.argv[2] || 'user@example.com'; // CHANGE TO YOUR EMAIL
var domains = [process.argv[3] || 'example.com']; // CHANGE TO YOUR DOMAIN
@ -17,8 +17,8 @@ var certStore = require('./cert-store');
var serve = require('./serve');
var closer;
var accountPrivateKeyPem = null;
var domainPrivateKeyPem = null;
var accountKeypair = null;
var domainKeypair = null;
var acmeUrls = null;
@ -44,14 +44,14 @@ function init() {
function getPrivateKeys(cb) {
console.log('Generating Account Keypair');
console.log("(Note: if you're using forge and not ursa, this will take a long time");
LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) {
const RSA = require('rsa-compat').RSA;
RSA.generateKeypair(2048, 65537, {}, function (err, pems) {
accountPrivateKeyPem = pems.privateKeyPem;
accountKeypair = pems;
console.log('Generating Domain Keypair');
LeCore.leCrypto.generateRsaKeypair(2048, 65537, function (err, pems) {
RSA.generateKeypair(2048, 65537, {}, function (err, pems2) {
domainPrivateKeyPem = pems.privateKeyPem;
domainKeypair = pems2;
cb();
});
});
@ -62,7 +62,7 @@ function runDemo() {
LeCore.registerNewAccount(
{ newRegUrl: acmeUrls.newReg
, email: email
, accountPrivateKeyPem: accountPrivateKeyPem
, accountKeypair: accountKeypair
, agreeToTerms: function (tosUrl, done) {
// agree to the exact version of these terms
@ -82,8 +82,8 @@ function runDemo() {
{ newAuthzUrl: acmeUrls.newAuthz
, newCertUrl: acmeUrls.newCert
, domainPrivateKeyPem: domainPrivateKeyPem
, accountPrivateKeyPem: accountPrivateKeyPem
, domainKeypair: domainKeypair
, accountKeypair: accountKeypair
, domains: domains
, setChallenge: challengeStore.set

View File

@ -8,9 +8,6 @@
"example": "example",
"test": "test"
},
"scripts": {
"test": "node example/letsencrypt.js"
},
"repository": {
"type": "git",
"url": "git+https://git.daplie.com/Daplie/le-acme-core.git"
@ -39,6 +36,7 @@
"better-assert": "^1.0.2",
"chai": "^3.5.0",
"chai-string": "^1.3.0",
"localhost.daplie.me-certificates": "^1.3.0",
"request-debug": "^0.2.0"
}
}