From 3ee5f32f5f82fc6ea204d5e80b73485d4d06b16b Mon Sep 17 00:00:00 2001 From: swee Date: Tue, 28 Jan 2025 14:52:18 -0800 Subject: [PATCH] Update server.py --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 64187aa..08a867f 100644 --- a/server.py +++ b/server.py @@ -172,9 +172,6 @@ for i in mods['command']: commandProviders.append(i.IRCatModule(**requires)) sockets = {} sockets_ssl = {} -context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) -context.minimum_version = ssl.TLSVersion.TLSv1 -context.set_ciphers('DEFAULT:@SECLEVEL=0') # Open the specified non-SSL sockets. for i in restrict_ip.split(" "): sockets[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -767,6 +764,9 @@ def ssl_session(sock): while True: try: while opened: + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.minimum_version = ssl.TLSVersion.TLSv1 + context.set_ciphers('DEFAULT:@SECLEVEL=0') context.load_cert_chain(ssl_cert, keyfile=ssl_pkey) print("Waiting for connection...") connection, client = sock.accept()