Skip to content

python 3.7 + openssl 3 on windows fails with ssl.SSLError: unknown error (_ssl.c:4034) #516

Description

@akrherz

Issue: I don't believe python 3.7 + openssl 3 is supported upstream, conda-forge python 3.7 + openssl 3 fails on windows.


Environment (conda list):
Details
$ conda list
# packages in environment at C:\Users\akrherz\Miniconda3\envs\py37:
#
# Name                    Version                   Build  Channel
ca-certificates           2021.10.8            h5b45459_0    conda-forge
openssl                   3.0.0                h8ffe710_1    conda-forge
pip                       21.3               pyhd8ed1ab_0    conda-forge
python                    3.7.10          h900ac77_102_cpython    conda-forge
python_abi                3.7                     2_cp37m    conda-forge
setuptools                58.2.0           py37h03978a9_0    conda-forge
sqlite                    3.36.0               h8ffe710_2    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
vc                        14.2                 hb210afc_5    conda-forge
vs2015_runtime            14.29.30037          h902a5da_5    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge

Details about conda and system ( conda info ):
Details
$ conda info
     active environment : py37
    active env location : C:\Users\akrherz\Miniconda3\envs\py37
            shell level : 2
       user config file : C:\Users\akrherz\.condarc
 populated config files : C:\Users\akrherz\.condarc
          conda version : 4.10.3
    conda-build version : not installed
         python version : 3.9.5.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\akrherz\Miniconda3  (writable)
      conda av data dir : C:\Users\akrherz\Miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\akrherz\Miniconda3\pkgs
                          C:\Users\akrherz\.conda\pkgs
                          C:\Users\akrherz\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\akrherz\Miniconda3\envs
                          C:\Users\akrherz\.conda\envs
                          C:\Users\akrherz\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.10.3 requests/2.25.1 CPython/3.9.5 Windows/10 Windows/10.0.19043
          administrator : False
             netrc file : None
           offline mode : False

Simple reproducer:

$ python -c "import urllib.request; urllib.request.urlopen('https://google.com')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 543, in _open
    '_open', req)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 1393, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\urllib\request.py", line 1318, in do_open
    h = http_class(host, timeout=req.timeout, **http_conn_args)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\http\client.py", line 1416, in __init__
    context = ssl._create_default_https_context()
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\ssl.py", line 589, in create_default_context
    context.load_default_certs(purpose)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\ssl.py", line 490, in load_default_certs
    self._load_windows_store_certs(storename, purpose)
  File "C:\Users\akrherz\Miniconda3\envs\py37\lib\ssl.py", line 482, in _load_windows_store_certs
    self.load_verify_locations(cadata=certs)
ssl.SSLError: unknown error (_ssl.c:4034)

Impact

See failures with conda-forge/cartopy-feedstock#125 for example

Looking upstream at the python git repo, we find Openssl 3 patches on the 3.8 branch, but not the 3.7 branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions