Add fallback certificate backend

This commit is contained in:
Johannes Zellner
2016-12-05 17:01:23 +01:00
parent eacc4412ba
commit b1be65d9ce
5 changed files with 35 additions and 3 deletions

21
src/cert/fallback.js Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
exports = module.exports = {
getCertificate: getCertificate,
// testing
_name: 'fallback'
};
var assert = require('assert'),
debug = require('debug')('box:cert/fallback.js');
function getCertificate(domain, options, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
debug('getCertificate: using fallback certificate', domain);
return callback(null, 'cert/host.cert', 'cert/host.key');
}