From 60a65f370927c306510ee5fc8bdefb0445d6f874 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Fri, 8 May 2020 19:27:45 -0400 Subject: [PATCH] various fixes --- src/commands/cwg_create.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/cwg_create.ts b/src/commands/cwg_create.ts index c16da15..f3135e7 100644 --- a/src/commands/cwg_create.ts +++ b/src/commands/cwg_create.ts @@ -1,5 +1,6 @@ import fs, { writeFile, unlink } from 'fs-extra'; import axios from 'axios'; +import { randomBytes } from 'crypto'; import { Message } from 'eris'; import { AccountInterface } from '../models'; import { Command, RichEmbed } from '../class'; @@ -87,7 +88,9 @@ export default class CWG_Create extends Command { .addField('Domain', domain.domain, true) .addField('Port', String(domain.port), true); - const cert = await parseCertificate(this.client, domain.x509.cert); + const certPath = `/opt/CloudServices/temp/${randomBytes(5).toString('hex')}`; + await writeFile(certPath, certs.cert, { encoding: 'utf8' }); + const cert = await parseCertificate(this.client, certPath); embed.addField('Certificate Issuer', cert.issuer.organizationName, true) .addField('Certificate Subject', cert.subject.commonName, true)