27 lines
749 B
JavaScript
Raw Permalink Normal View History

2019-07-22 23:31:48 -06:00
#!/usr/bin/env node
'use strict';
// See https://git.coolaj86.com/coolaj86/acme-challenge-test.js
var tester = require('acme-challenge-test');
require('dotenv').config();
2019-07-30 21:46:43 -06:00
// Usage: node ./test.js example.com username xxxxxxxxx
var record = process.argv[2] || process.env.RECORD;
2019-07-22 23:31:48 -06:00
var challenger = require('./index.js').create({
2019-07-30 21:46:43 -06:00
webroot:
'/tmp/acme-tests/{domain}/.well-known/acme-challenges/' ||
process.env.WEBROOT
2019-07-22 23:31:48 -06:00
});
// The dry-run tests can pass on, literally, 'example.com'
// but the integration tests require that you have control over the domain
tester
2019-07-30 21:46:43 -06:00
.testRecord('http-01', record, challenger)
2019-07-22 23:31:48 -06:00
.then(function() {
2019-07-30 21:46:43 -06:00
console.info('PASS', record);
2019-07-22 23:31:48 -06:00
})
.catch(function(e) {
console.error(e.message);
console.error(e.stack);
});