From 41c230ad9c40400a595896f6a3f1f56cc8d0ca47 Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Sat, 20 Jun 2026 00:19:24 +0200 Subject: [PATCH] install.bat: fix discord import check for Windows SSL cert store bug discord.py imports aiohttp which calls ssl.create_default_context() at import time. A malformed cert in the Windows cert store raises ASN1 NOT_ENOUGH_DATA. The bot patches this at runtime via _patch_ssl(); the install check now applies the same workaround (null-patch load_default_certs) so discord: OK on all machines. Co-Authored-By: Claude Sonnet 4.6 --- install.bat | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install.bat b/install.bat index 5571188..bee48f6 100644 --- a/install.bat +++ b/install.bat @@ -327,7 +327,7 @@ if "%OCR_READY%"=="0" ( echo. echo Verifying all dependencies... set "ALL_OK=1" -for %%M in (cv2 mss numpy discord transitions rapidfuzz) do ( +for %%M in (cv2 mss numpy transitions rapidfuzz) do ( set "PATH=%TESS_PATH%;%PATH%" "%CONDA_EXE%" run -n botty python -c "import %%M" >nul 2>&1 if !errorlevel! neq 0 ( @@ -337,6 +337,17 @@ for %%M in (cv2 mss numpy discord transitions rapidfuzz) do ( echo %%M: OK ) ) +:: discord.py imports aiohttp which calls ssl.create_default_context() at import +:: time. A malformed cert in the Windows store triggers ASN1 NOT_ENOUGH_DATA. +:: The bot patches this at runtime via _patch_ssl(); check import with the patch. +set "PATH=%TESS_PATH%;%PATH%" +"%CONDA_EXE%" run -n botty python -c "import ssl; ssl.SSLContext.load_default_certs = lambda *a, **kw: None; import discord" >nul 2>&1 +if !errorlevel! neq 0 ( + echo FAILED: discord + set "ALL_OK=0" +) else ( + echo discord: OK +) if "%OCR_READY%"=="0" set "ALL_OK=0" if "%ALL_OK%"=="1" (