[irc] A temporary workaround for SSL contexts.

This commit is contained in:
Fabio Manganiello 2024-11-20 01:35:44 +01:00
parent 61b2afce91
commit 010b52ed19
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -74,6 +74,8 @@ class IRCBot(irc.bot.SingleServerIRCBot):
if ssl: if ssl:
self._ssl_ctx = _ssl.create_default_context() self._ssl_ctx = _ssl.create_default_context()
# Temporary workaround for check_hostname issues on Python >= 3.12
self._ssl_ctx.check_hostname = False
connection_factory.wrapper = self._ssl_ctx.wrap_socket connection_factory.wrapper = self._ssl_ctx.wrap_socket
if ipv6: if ipv6:
connection_factory.family = socket.AF_INET6 connection_factory.family = socket.AF_INET6