Browse Source

working, huzzah!

wip
AJ ONeal 5 years ago
parent
commit
fd62408a9a
  1. 2
      certificates.js
  2. 9
      greenlock.js
  3. 4
      utils.js

2
certificates.js

@ -214,6 +214,7 @@ C._check = function(db, args) {
certificate: args.certificate
};
return db.check(query).then(function(pems) {
console.log('[debug] has pems? (yes)', pems);
if (!pems) {
return null;
}
@ -234,6 +235,7 @@ C._check = function(db, args) {
return U._getKeypair(db, args.subject, query)
.then(function(keypair) {
console.log('[debug get keypair]', Object.keys(keypair));
pems.privkey = keypair.privateKeyPem;
return pems;
})

9
greenlock.js

@ -310,7 +310,14 @@ G.create = function(gconf) {
challenges,
account,
args
);
).then(function(pems) {
if (!pems.privkey) {
throw new Error(
'missing private key, which is kinda important'
);
}
return pems;
});
});
});
});

4
utils.js

@ -263,5 +263,7 @@ U._getOrCreateKeypair = function(db, subject, query, keyType, mustExist) {
};
U._getKeypair = function(db, subject, query) {
return U._getOrCreateKeypair(db, subject, query, '', true);
return U._getOrCreateKeypair(db, subject, query, '', true).then(function (result) {
return result.keypair;
});
};

Loading…
Cancel
Save