2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								# [acme-http-01-{{servicename}}.js](https://git.rootprojects.org/root/acme-http-01-{{servicename}}.js) | a [Root](https://rootprojects.org/) project
  
						 
					
						
							
								
									
										
										
										
											2019-07-23 05:23:35 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								{{ Service Title }} Storage + Let's Encrypt for Node.js - ACME http-01 challenges w/ ACME.js and Greenlock.js
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Handles ACME http-01 challenges. Compatible with ACME.js and Greenlock.js. Passes acme-http-01-test.
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Features
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    Compatible 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								    -    Let’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    -    {{ Service Title }} API
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    -    ACME.js, Greenlock.js, and others
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    Quality 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    -    node v6 compatible VanillaJS
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    -    <  150  lines  of  code 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    -    Zero Dependencies
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Install
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								npm install --save acme-http-01-{{servicename}}
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{{ Service Title }} Token:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    Login to your account at: {{ Service URL }} 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    {{ Instructions to generate token }} 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Usage
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								First you create an instance with your credentials:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								var http01 = require('acme-http-01-{{servicename}}').create({
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									baseUrl: '{{ api url }}', // default
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									token: 'xxxx'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Then you can use it with any compatible ACME library, such as Greenlock.js or ACME.js.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## Greenlock.js
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var Greenlock = require('greenlock-express');
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var greenlock = Greenlock.create({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									challenges: {
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										'http-01': http01
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									}
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									// ...
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								});
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								See [Greenlock Express ](https://git.rootprojects.org/root/greenlock-express.js ) and/or [Greenlock.js ](https://git.rootprojects.org/root/greenlock.js ) documentation for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## ACME.js
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								// TODO
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								See the [ACME.js ](https://git.rootprojects.org/root/acme-v2.js ) for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## Build your own
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								There are only 4 methods:
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    `init(config)`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    `set(opts)`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    `get(opts)`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    `remove(opts)`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								http01
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									.set({
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 23:35:08 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										identifier: { value: 'foo.example.co.uk' },
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										token: 'xxxx'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										keyAuthorization: 'xxxx.yyyy'
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									.then(function() {
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										console.log('Saved ACME key authorization file');
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									})
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									.catch(function(err) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										console.error('Failed to save ACME key authorization file');
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										console.error(err);
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									});
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								See acme-http-01-test for more implementation details.
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Tests
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# node ./test.js domain-zone api-token
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								node ./test.js example.com xxxxxx
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Authors
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-    AJ ONeal 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								See AUTHORS for contact info.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Legal
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-30 21:46:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								[acme-http-01-{{servicename}}.js ](https://git.coolaj86.com/coolaj86/acme-http-01-{{servicename}}.js ) | MPL-2.0 | [Terms of Use ](https://therootcompany.com/legal/#terms ) | [Privacy Policy ](https://therootcompany.com/legal/#privacy )
							 
						 
					
						
							
								
									
										
										
										
											2019-07-23 02:46:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Copyright 2019 AJ ONeal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Copyright 2019 The Root Group LLC