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');
|
|
|
|
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
|
|
|
|
// * forge (fallback)
|
|
|
|
Object.keys(leUrsa).forEach(function (key) {
|
|
|
|
if (!leCrypto[key]) {
|
|
|
|
leCrypto[key] = leUrsa[key];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
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;
|