diff -rupN --no-dereference Python-3.10.9/Lib/ssl.py Python-3.10.9-new/Lib/ssl.py --- Python-3.10.9/Lib/ssl.py 2022-12-06 19:31:21.000000000 +0100 +++ Python-3.10.9-new/Lib/ssl.py 2022-12-08 09:37:02.842024939 +0100 @@ -250,7 +250,7 @@ class _TLSMessageType(_IntEnum): CHANGE_CIPHER_SPEC = 0x0101 -if sys.platform == "win32": +if sys.platform == "win32" and sys.version.find("GCC") == -1: from _ssl import enum_certificates, enum_crls from socket import socket, SOCK_STREAM, create_connection @@ -587,7 +587,7 @@ class SSLContext(_SSLContext): def load_default_certs(self, purpose=Purpose.SERVER_AUTH): if not isinstance(purpose, _ASN1Object): raise TypeError(purpose) - if sys.platform == "win32": + if sys.platform == "win32" and sys.version.find("GCC") == -1: for storename in self._windows_cert_stores: self._load_windows_store_certs(storename, purpose) self.set_default_verify_paths() diff -rupN --no-dereference Python-3.10.9/setup.py Python-3.10.9-new/setup.py --- Python-3.10.9/setup.py 2022-12-08 09:37:02.838024939 +0100 +++ Python-3.10.9-new/setup.py 2022-12-08 09:37:02.842024939 +0100 @@ -2522,6 +2522,8 @@ class PyBuildExt(build_ext): openssl_includes = split_var('OPENSSL_INCLUDES', '-I') openssl_libdirs = split_var('OPENSSL_LDFLAGS', '-L') openssl_libs = split_var('OPENSSL_LIBS', '-l') + if HOST_PLATFORM.startswith(('mingw', 'win')): + openssl_libs += ['ws2_32'] openssl_rpath = config_vars.get('OPENSSL_RPATH') if not openssl_libs: # libssl and libcrypto not found @@ -2544,6 +2546,7 @@ class PyBuildExt(build_ext): runtime_library_dirs = [openssl_rpath] openssl_extension_kwargs = dict( + extra_compile_args=['-DOPENSSL_NO_SSL3'], include_dirs=openssl_includes, library_dirs=openssl_libdirs, libraries=openssl_libs,