Compare commits

..

4 Commits

Author SHA1 Message Date
f16dbeea32 2.0.26 2019-01-13 21:40:40 +01:00
a0c0230419 fix(core): update 2019-01-13 21:40:40 +01:00
0d1ebf2d1a 2.0.25 2019-01-13 19:40:32 +01:00
6edbf3cb46 fix(core): update 2019-01-13 19:40:32 +01:00
4 changed files with 14 additions and 7 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartacme",
"version": "2.0.24",
"version": "2.0.26",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartacme",
"version": "2.0.24",
"version": "2.0.26",
"private": false,
"description": "acme implementation in TypeScript",
"main": "dist/index.js",
@ -35,7 +35,7 @@
"@pushrocks/smartstring": "^3.0.8",
"@pushrocks/smarttime": "^3.0.5",
"@pushrocks/smartunique": "^3.0.1",
"acme-client": "^2.2.2"
"acme-client": "2.2.2"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.4",

View File

@ -35,7 +35,7 @@ export class CertManager {
// Pending Map
this.pendingMap = new plugins.lik.Stringmap();
};
}
/**
* retrieves a certificate
@ -64,8 +64,8 @@ export class CertManager {
*/
public async storeCertificate(optionsArg: ICert) {
const cert = new Cert(optionsArg);
cert.save();
};
await cert.save();
}
public async deleteCertificate(domainNameArg: string) {

View File

@ -16,6 +16,7 @@ export interface ISmartAcmeOptions {
setChallenge: (domainName: string, keyAuthorization: string) => Promise<any>;
removeChallenge: (domainName: string) => Promise<any>;
validateRemoteRequest: () => Promise<boolean>;
environment: 'production' | 'integration';
}
/**
@ -107,7 +108,13 @@ export class SmartAcme {
// ACME Client
this.client = new plugins.acme.Client({
directoryUrl: plugins.acme.directory.letsencrypt.staging,
directoryUrl: (() => {
if(this.options.environment === 'production') {
return plugins.acme.directory.letsencrypt.production;
} else {
return plugins.acme.directory.letsencrypt.staging;
}
})(),
accountKey: this.privateKey
});