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)