From: jweigele Date: Sun, 14 Aug 2022 05:07:59 +0000 (-0700) Subject: Fixed the deprecated stuff and added slight debug code X-Git-Url: http://git.hexthepla.net/?a=commitdiff_plain;h=866cfa54cff9c7dc49b27d4696e8c47dea9e8d33;p=grahbot Fixed the deprecated stuff and added slight debug code --- diff --git a/Dockerfile b/Dockerfile index 7ab1f20..a5e53f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN apk add py3-pip RUN apk add py3-cffi RUN apk add gcc RUN apk add make +RUN pip3 install SSLContext RUN pip3 install pynacl RUN pip3 install discord.py asynqp RUN pip3 install aioprometheus diff --git a/grahbot.py b/grahbot.py index 0ca5912..94bd706 100755 --- a/grahbot.py +++ b/grahbot.py @@ -4,6 +4,7 @@ import discord import socket import random import ssl +import sslcontext import asynqp import discord.voice_client import datetime @@ -106,12 +107,12 @@ class HornClient(object): log.debug('>> {}'.format(msg.body)) async def rabbit_connect(self): - log.debug('Creating rabbitmq socket') + log.debug('Creating rabbitmq socket to {}:{}'.format(self.rabbit_config['host'], int(self.rabbit_config['port']))) # CREATE SOCKET sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # WRAP SOCKET - sock = ssl.wrap_socket(sock) + sock = sslcontext.wrap_socket(sock) sock.connect((self.rabbit_config['host'], int(self.rabbit_config['port']))) connection = await asynqp.connect(virtual_host=self.rabbit_config['vhost'], username=self.rabbit_config['user'], password=self.rabbit_config['password'], sock=sock)