Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8e255938b5 | |||
f2eb9666a7 | |||
cbdb0c8b08 | |||
f821f4d9cc |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "2.0.32",
|
"version": "2.0.34",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "2.0.32",
|
"version": "2.0.34",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "acme implementation in TypeScript",
|
"description": "acme implementation in TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -56,9 +56,11 @@ export class SmartAcme {
|
|||||||
res: plugins.smartexpress.Response
|
res: plugins.smartexpress.Response
|
||||||
) => {
|
) => {
|
||||||
const requestBody: interfaces.ICertRemoteRequest = req.body;
|
const requestBody: interfaces.ICertRemoteRequest = req.body;
|
||||||
|
this.logger.log('ok', `got certificate request for ${requestBody.domainName}`);
|
||||||
const certDomain = this.certmatcher.getCertificateDomainNameByDomainName(
|
const certDomain = this.certmatcher.getCertificateDomainNameByDomainName(
|
||||||
requestBody.domainName
|
requestBody.domainName
|
||||||
);
|
);
|
||||||
|
this.logger.log('ok', `mapping ${requestBody.domainName} to ${certDomain}`);
|
||||||
let status: interfaces.TCertStatus = await this.certmanager.getCertificateStatus(certDomain);
|
let status: interfaces.TCertStatus = await this.certmanager.getCertificateStatus(certDomain);
|
||||||
let response: interfaces.ICertRemoteResponse;
|
let response: interfaces.ICertRemoteResponse;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@ -139,11 +141,12 @@ export class SmartAcme {
|
|||||||
|
|
||||||
public async getCertificateForDomain(domainArg: string): Promise<Cert> {
|
public async getCertificateForDomain(domainArg: string): Promise<Cert> {
|
||||||
const certDomain = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
|
const certDomain = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
|
||||||
await this.certmanager.announceCertificate(certDomain);
|
|
||||||
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomain);
|
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomain);
|
||||||
|
|
||||||
if (retrievedCertificate) {
|
if (retrievedCertificate) {
|
||||||
return retrievedCertificate;
|
return retrievedCertificate;
|
||||||
|
} else {
|
||||||
|
await this.certmanager.announceCertificate(certDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Place new order */
|
/* Place new order */
|
||||||
|
Reference in New Issue
Block a user