diff --git a/package.json b/package.json index 1ccb0b7..1dfcba7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/ts/smartacme.classes.certmanager.ts b/ts/smartacme.classes.certmanager.ts index afbc4cc..496bc18 100644 --- a/ts/smartacme.classes.certmanager.ts +++ b/ts/smartacme.classes.certmanager.ts @@ -35,7 +35,7 @@ export class CertManager { // Pending Map this.pendingMap = new plugins.lik.Stringmap(); - }; + } /** * retrieves a certificate diff --git a/ts/smartacme.classes.smartacme.ts b/ts/smartacme.classes.smartacme.ts index f5cc538..f351c82 100644 --- a/ts/smartacme.classes.smartacme.ts +++ b/ts/smartacme.classes.smartacme.ts @@ -16,6 +16,7 @@ export interface ISmartAcmeOptions { setChallenge: (domainName: string, keyAuthorization: string) => Promise; removeChallenge: (domainName: string) => Promise; validateRemoteRequest: () => Promise; + 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 });