From 945d60dc9d8ce4ba54cc1c9417d4e510b5b4fd75 Mon Sep 17 00:00:00 2001 From: botbikamordehai2-sketch Date: Mon, 8 Jun 2026 13:10:12 +0000 Subject: [PATCH] fix: add SSL certificate verification bypass for Windows 8 (closes #122) --- code/tutorlib/online/session.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/tutorlib/online/session.py b/code/tutorlib/online/session.py index 13e36da..e179304 100644 --- a/code/tutorlib/online/session.py +++ b/code/tutorlib/online/session.py @@ -44,12 +44,19 @@ SERVER = 'http://csse1001.uqcloud.net/cgi-bin/mpt3/mpt_cgi.py' +import ssl + def make_opener(): """Make a URL opener with cookies enabled, and proxies disabled.""" cookiejar = http.cookiejar.CookieJar() proxy_handler = urllib.request.ProxyHandler(proxies={}) cookie_processor = urllib.request.HTTPCookieProcessor(cookiejar=cookiejar) - opener = urllib.request.build_opener(cookie_processor, proxy_handler) + # Disable SSL certificate verification to work around issues on Windows 8 + ssl_context = ssl.create_default_context() + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + https_handler = urllib.request.HTTPSHandler(context=ssl_context) + opener = urllib.request.build_opener(cookie_processor, proxy_handler, https_handler) return opener