I would like to join this discussion, since I’m facing the same problems, although in a different and maybe not that usual environment…
So, to begin, I’m using Blender with Python for optimizing rendering (and other parameters) by applying Evolutionary Algorithms and Deep Neural Networks. For the latter I’m using the framework Pytorch (https://pytorch.org). That means, for installing all the Python 3rd Party libs I need, I directly called the Python executable within the Blender distribution (I’m using 2.82) with pip install (\python3.7m -m pip install ).
The problem I’m facing is that I get the abovementioned error (CERTIFICATE_VALIDATE_FAILED) when Pytorch tries to download pre-trained networks, e.g. from https://download.pytorch.org/models/vgg16-397923af.pth). It does this by simply calling “urlopen”.
Surprisingly I have no troubles starting this in Windows (Windows 10). It works w/o anything to do. Only when I downloaded the Blender Linux executables and started exactly the same code (always with blender -b -P script.py) there (Ubuntu 18.04.4 LTS bionic), it stumbled over the certificates.
Blender Python seems to ignore the certificates when started under Linux, since they are there (in the certifi module in site-packages, as mentioned).
Currently I inserted a workaround before the urlopen call in Pytorch. With
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
u = urlopen(url, context=ctx)
the certificate check is simply switched off. So, I can proceed, there is no rush for an immediate solution, but it would be nice to have one, since in each future update, when I install my Python 3rd party libs, I have to make sure not to forget to insert this workaround. Beyond the fact that although this is all (thankfully) open source, it is not best thing to do, to firstly alter the software you’re applying …
Thanks in advance for any hint,