le-acme-core.js/lib/node.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-12-15 22:07:02 +00:00
/*!
2015-12-16 02:58:53 +00:00
* letiny-core
2015-12-15 22:07:02 +00:00
* Copyright(c) 2015 AJ ONeal <aj@daplie.com> https://daplie.com
* Apache-2.0 OR MIT (and hence also MPL 2.0)
*/
'use strict';
var request = require('request');
2015-12-16 02:36:10 +00:00
var leUtils = require('./acme-util');
2015-12-15 22:07:02 +00:00
var leCrypto = require('./letsencrypt-node-crypto');
2015-12-16 04:05:45 +00:00
var leExtra = require('./letsencrypt-forge-extra');
2015-12-15 22:07:02 +00:00
var leForge = require('./letsencrypt-forge');
var leUrsa;
try {
leUrsa = require('./letsencrypt-ursa');
} catch(e) {
leUrsa = {};
// things will run a little slower on keygen, but it'll work on windows
// (but don't try this on raspberry pi - 20+ MINUTES key generation)
}
// order of crypto precdence is
// * native
// * ursa
2015-12-16 04:05:45 +00:00
// * forge extra (the new one aimed to be less-forgey)
2015-12-15 22:07:02 +00:00
// * forge (fallback)
Object.keys(leUrsa).forEach(function (key) {
if (!leCrypto[key]) {
leCrypto[key] = leUrsa[key];
}
});
2015-12-16 04:05:45 +00:00
Object.keys(leExtra).forEach(function (key) {
if (!leCrypto[key]) {
leCrypto[key] = leExtra[key];
}
});
2015-12-15 22:07:02 +00:00
Object.keys(leForge).forEach(function (key) {
if (!leCrypto[key]) {
leCrypto[key] = leForge[key];
}
});
module.exports.request = request;
module.exports.leCrypto = leCrypto;
2015-12-16 01:18:40 +00:00
module.exports.leUtils = leUtils;