|
|
@ -1,33 +1,16 @@ |
|
|
|
'use strict'; |
|
|
|
/*global Promise*/ |
|
|
|
|
|
|
|
var challenge = require('./').create({}); |
|
|
|
var tester = require('greenlock-challenge-test'); |
|
|
|
|
|
|
|
var opts = challenge.getOptions && challenge.getOptions() || challenge.options; |
|
|
|
var type = 'http-01'; |
|
|
|
//var challenger = require('greenlock-challenge-http').create({});
|
|
|
|
var challenger = require('./').create({}); |
|
|
|
|
|
|
|
function run() { |
|
|
|
// this will cause the prompt to appear
|
|
|
|
return new Promise(function (resolve, reject) { |
|
|
|
challenge.set(opts, function () { |
|
|
|
// this will cause the final completion message to appear
|
|
|
|
return Promise.resolve(challenge.remove(opts)).then(resolve).catch(reject); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
// The dry-run tests can pass on, literally, 'example.com'
|
|
|
|
// but the integration tests require that you have control over the domain
|
|
|
|
var domain = 'example.com'; |
|
|
|
|
|
|
|
opts.challenge = { |
|
|
|
type: 'dns-01' |
|
|
|
, identifier: { type: 'dns', value: 'example.com' } |
|
|
|
, wildcard: true |
|
|
|
, expires: '2012-01-01T12:00:00.000Z' |
|
|
|
, token: 'abc123' |
|
|
|
, thumbprint: '<<account key thumbprint>>' |
|
|
|
, keyAuthorization: 'abc123.xxxx' |
|
|
|
, dnsHost: '_acme-challenge.example.com' |
|
|
|
, dnsAuthorization: 'yyyy' |
|
|
|
, altname: '*.example.com' |
|
|
|
}; |
|
|
|
run(opts).then(function () { |
|
|
|
tester.test(type, domain, challenger).then(function () { |
|
|
|
console.info("PASS"); |
|
|
|
}).catch(function (err) { |
|
|
|
console.error("FAIL"); |
|
|
|