diff --git a/docker/accessbot/accessbot.py b/docker/accessbot/accessbot.py index af1bfe7f83..ef836aad13 100755 --- a/docker/accessbot/accessbot.py +++ b/docker/accessbot/accessbot.py @@ -17,6 +17,7 @@ import configparser import argparse +import functools import irc.client import logging import ssl @@ -47,7 +48,12 @@ class SetAccess(irc.client.SimpleIRCClient): self.changes = [] self.identified = False if self.port == 6697: - factory = irc.connection.Factory(wrapper=ssl.wrap_socket) + # Taken from the example in the Factory class docstring at + # https://github.com/jaraco/irc/blob/main/irc/connection.py + context = ssl.create_default_context() + wrapper = functools.partial( + context.wrap_socket, server_hostname=self.server) + factory = irc.connection.Factory(wrapper=wrapper) self.connect(self.server, self.port, self.nick, connect_factory=factory) else: