Compare commits
	
		
			No commits in common. "69b624c6320445b4da581caf5abed4a408fa2e47" and "33e10c77d8c64971f824cb2b3797009a398cd72d" have entirely different histories.
		
	
	
		
			69b624c632
			...
			33e10c77d8
		
	
		
@ -29,12 +29,11 @@ In progress
 | 
			
		||||
* Apr  5, 2018 - test subdomains and its wildcard
 | 
			
		||||
* Apr  5, 2018 - test http and dns challenges (success and failure)
 | 
			
		||||
* Apr  5, 2018 - export http and dns challenge tests
 | 
			
		||||
* Apr 10, 2018 - tested backwards-compatibility using greenlock.js
 | 
			
		||||
 | 
			
		||||
Todo
 | 
			
		||||
 | 
			
		||||
* support ECDSA keys
 | 
			
		||||
* Apr  5, 2018 - appears that sometimes 'pending' status cannot be progressed to 'processing' nor 'deactivated'
 | 
			
		||||
* support ECDSA keys
 | 
			
		||||
 | 
			
		||||
## Let's Encrypt Directory URLs
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								compat.js
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								compat.js
									
									
									
									
									
								
							@ -24,30 +24,11 @@ function create(deps) {
 | 
			
		||||
    acme2.accounts.create(options).then(resolveFn(cb), rejectFn(cb));
 | 
			
		||||
  };
 | 
			
		||||
  acme2.getCertificate = function (options, cb) {
 | 
			
		||||
    options.agreeToTerms = options.agreeToTerms || function (tos) {
 | 
			
		||||
      return Promise.resolve(tos);
 | 
			
		||||
    };
 | 
			
		||||
    acme2.certificates.create(options).then(function (chainPem) {
 | 
			
		||||
      var privkeyPem = acme2.RSA.exportPrivatePem(options.domainKeypair);
 | 
			
		||||
      resolveFn(cb)({
 | 
			
		||||
        cert: chainPem.split(/[\r\n]{2,}/g)[0] + '\r\n'
 | 
			
		||||
      , privkey: privkeyPem 
 | 
			
		||||
      , chain: chainPem.split(/[\r\n]{2,}/g)[1] + '\r\n'
 | 
			
		||||
      });
 | 
			
		||||
    }, rejectFn(cb));
 | 
			
		||||
    acme2.certificates.create(options).then(resolveFn(cb), rejectFn(cb));
 | 
			
		||||
  };
 | 
			
		||||
  acme2.getAcmeUrls = function (options, cb) {
 | 
			
		||||
    acme2.init(options).then(resolveFn(cb), rejectFn(cb));
 | 
			
		||||
  };
 | 
			
		||||
  acme2.getOptions = function () {
 | 
			
		||||
    var defs = {};
 | 
			
		||||
 | 
			
		||||
    Object.keys(module.exports.defaults).forEach(function (key) {
 | 
			
		||||
      defs[key] = defs[deps] || module.exports.defaults[key];
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return defs;
 | 
			
		||||
  };
 | 
			
		||||
  acme2.stagingServerUrl = module.exports.defaults.stagingServerUrl;
 | 
			
		||||
  acme2.productionServerUrl = module.exports.defaults.productionServerUrl;
 | 
			
		||||
  return acme2;
 | 
			
		||||
@ -60,9 +41,8 @@ module.exports.defaults = {
 | 
			
		||||
, knownEndpoints:         [ 'keyChange', 'meta', 'newAccount', 'newNonce', 'newOrder', 'revokeCert' ]
 | 
			
		||||
, challengeTypes:         [ 'http-01', 'dns-01' ]
 | 
			
		||||
, challengeType:          'http-01'
 | 
			
		||||
//, keyType:                'rsa' // ecdsa
 | 
			
		||||
//, keySize:                2048 // 256
 | 
			
		||||
, rsaKeySize:             2048 // 256
 | 
			
		||||
, keyType:                'rsa' // ecdsa
 | 
			
		||||
, keySize:                2048 // 256
 | 
			
		||||
};
 | 
			
		||||
Object.keys(module.exports.defaults).forEach(function (key) {
 | 
			
		||||
  module.exports.ACME[key] = module.exports.defaults[key];
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								node.js
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								node.js
									
									
									
									
									
								
							@ -452,17 +452,6 @@ ACME._getCertificate = function (me, options) {
 | 
			
		||||
    options.challengeTypes = [ options.challengeType ];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!me._kid) {
 | 
			
		||||
    if (options.accountKid) {
 | 
			
		||||
      me._kid = options.accountKid;
 | 
			
		||||
    } else {
 | 
			
		||||
      //return Promise.reject(new Error("must include KeyID"));
 | 
			
		||||
      return ACME._registerAccount(me, options).then(function () {
 | 
			
		||||
        return ACME._getCertificate(me, options);
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (me.debug) { console.log('[acme-v2] certificates.create'); }
 | 
			
		||||
  return ACME._getNonce(me).then(function () {
 | 
			
		||||
    var body = {
 | 
			
		||||
@ -502,9 +491,7 @@ ACME._getCertificate = function (me, options) {
 | 
			
		||||
      //console.log('[DEBUG] finalize:', me._finalize); return;
 | 
			
		||||
 | 
			
		||||
      if (!me._authorizations) {
 | 
			
		||||
        console.error("[acme-v2.js] authorizations were not fetched:");
 | 
			
		||||
        console.error(resp.body);
 | 
			
		||||
        return Promise.reject(new Error("authorizations were not fetched"));
 | 
			
		||||
        console.error("[acme-v2.js] authorizations were not fetched");
 | 
			
		||||
      }
 | 
			
		||||
      if (me.debug) { console.log("47 &#&#&#&#&#&#&&##&#&#&#&#&#&#&#&"); }
 | 
			
		||||
 | 
			
		||||
@ -547,10 +534,7 @@ ACME._getCertificate = function (me, options) {
 | 
			
		||||
 | 
			
		||||
        return ACME._finalizeOrder(me, options, validatedDomains);
 | 
			
		||||
      }).then(function () {
 | 
			
		||||
        console.log('acme-v2: order was finalized');
 | 
			
		||||
        return me._request({ method: 'GET', url: me._certificate, json: true }).then(function (resp) {
 | 
			
		||||
          console.log('acme-v2: csr submitted and cert received:');
 | 
			
		||||
          console.log(resp.body);
 | 
			
		||||
          return resp.body;
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
@ -560,8 +544,6 @@ ACME._getCertificate = function (me, options) {
 | 
			
		||||
 | 
			
		||||
ACME.create = function create(me) {
 | 
			
		||||
  if (!me) { me = {}; }
 | 
			
		||||
  //
 | 
			
		||||
  me.debug = true;
 | 
			
		||||
  me.acmeChallengePrefix = ACME.acmeChallengePrefix;
 | 
			
		||||
  me.acmeChallengeDnsPrefix = ACME.acmeChallengeDnsPrefix;
 | 
			
		||||
  me.acmeChallengePrefixes = ACME.acmeChallengePrefixes;
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "acme-v2",
 | 
			
		||||
  "version": "0.9.0",
 | 
			
		||||
  "version": "0.6.2",
 | 
			
		||||
  "description": "A framework for building letsencrypt clients (and other ACME v2 clients), forked from le-acme-core.js.",
 | 
			
		||||
  "homepage": "https://git.coolaj86.com/coolaj86/acme-v2.js",
 | 
			
		||||
  "main": "node.js",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user