diff --git a/src/commands/tls.ts b/src/commands/tls.ts index 0b3aae3..9dd3789 100644 --- a/src/commands/tls.ts +++ b/src/commands/tls.ts @@ -1,5 +1,6 @@ /* eslint-disable no-plusplus */ import cheerio from 'cheerio'; +import https from 'https'; import axios, { AxiosError, AxiosResponse } from 'axios'; import { Message } from 'eris'; import { Client, Command, RichEmbed } from '../class'; @@ -62,6 +63,7 @@ export default class TLS extends Command { public async run(message: Message, args: string[]) { try { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); + https.globalAgent.options.rejectUnauthorized = false; let r: AxiosResponse; let s: AxiosResponse; @@ -159,8 +161,10 @@ export default class TLS extends Command { embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setTimestamp(); + https.globalAgent.options.rejectUnauthorized = true; return message.channel.createMessage({ embed }); } catch (err) { + https.globalAgent.options.rejectUnauthorized = true; return this.client.util.handleError(err, message, this, false); } }