acme-challenge-test.js/README.md

71 lines
2.4 KiB
Markdown
Raw Normal View History

2019-06-06 06:15:51 +00:00
# [acme-challenge-test](https://git.rootprojects.org/root/acme-challenge-test.js.git) | a [Root](https://rootprojects.org) project
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
Test harness for ACME http-01 and dns-01 challenges for Let's Encrypt Free SSL integration.
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
This was specificially designed for [ACME.js](https://git.coolaj86.com/coolaj86/acme-v2.js) and [Greenlock.js](https://git.coolaj86.com/coolaj86/greenlock-express.js), but will be generically useful to any ACME module.
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
> If you are building a plugin, please let us know.
> We may like to co-author and help maintain and promote your module.
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
This package has been split in two for the purpose of keeping the documentation clear and concise.
2019-06-06 05:41:27 +00:00
2019-06-13 07:32:52 +00:00
## ACME http-01
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
Use this for quick-and-easy, average-joe kind of stuff.
2019-04-07 21:55:48 +00:00
2019-06-13 07:43:57 +00:00
- See <https://git.rootprojects.org/root/acme-http-01-test.js>
2019-04-07 21:55:48 +00:00
2019-06-13 07:32:52 +00:00
## ACME dns-01
2019-06-13 07:32:52 +00:00
Use this for wildcards, and private and local domains.
2019-06-13 07:43:57 +00:00
- See <https://git.rootprojects.org/root/acme-dns-01-test.js>
2019-04-07 21:55:48 +00:00
2019-04-16 04:50:02 +00:00
## Reference Implementations
These are plugins that use the v2.7+ (v3) API, and pass this test harness,
which you should use as a model for any plugins that you create.
2019-06-13 07:32:52 +00:00
- http-01
- [`acme-http-01-cli`](https://git.rootprojects.org/root/acme-http-01-cli.js)
- [`acme-http-01-fs`](https://git.rootprojects.org/root/acme-http-01-fs.js)
- dns-01
- [`acme-dns-01-cli`](https://git.rootprojects.org/root/acme-dns-01-cli.js)
- [`acme-dns-01-digitalocean`](https://git.rootprojects.org/root/acme-dns-01-digitalocean.js)
2019-04-16 04:50:02 +00:00
You can find other implementations by searching npm for [acme-http-01-](https://www.npmjs.com/search?q=acme-http-01-)
and [acme-dns-01-](https://www.npmjs.com/search?q=acme-dns-01-).
2019-06-06 05:41:27 +00:00
## Starter Template
2019-06-13 07:32:52 +00:00
Just so you have an idea, this is typically how you'd start passing the tests:
2019-06-06 05:41:27 +00:00
```js
2019-06-06 06:49:46 +00:00
var tester = require('acme-challenge-test');
2019-06-06 05:41:27 +00:00
// The dry-run tests can pass on, literally, 'example.com'
// but the integration tests require that you have control over the domain
2019-06-06 06:49:46 +00:00
var domain = 'example.com';
tester
2019-06-13 07:36:25 +00:00
.testRecord('http-01', domain, {
set: function(opts) {
console.log('set opts:', opts);
throw new Error('set not implemented');
},
remove: function(opts) {
console.log('remove opts:', opts);
throw new Error('remove not implemented');
},
get: function(opts) {
console.log('get opts:', opts);
throw new Error('get not implemented');
}
})
.then(function() {
console.info('PASS');
});
2019-06-06 05:41:27 +00:00
```