我在一个有自签名证书的公司代理后面工作。我已经详细地记录了这一点。
问题
TLS/SSL模块没有正确加载,甚至无法验证证书。
-
视窗10
-
-
git版本2.19.0.windows.1
问题
python -c "import ssl"
我可以让它在Anaconda提示符下工作,但不能在gitbash中工作。为什么会有区别?
我从最新的Anaconda发行版2018.12的基本安装开始,并尝试安装
redis
.
$ pip install redis
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting redis
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/redis/
...
Could not fetch URL https://pypi.org/simple/redis/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/redis/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement redis (from versions: )
No matching distribution found for redis
所以这很奇怪。
SSLError("Can't connect to HTTPS URL because the SSL module is not available.")
ssl
.
$ python -c "import ssl"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\username\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified procedure could not be found.
(base) C:\Users\username> python -c "import ssl"
(base) C:\Users\username>
(base) C:\Users\username> conda deactivate
C:\Users\username>
C:\Users\username> python -c "import ssl"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\username\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified procedure could not be found.
停用基本conda环境后,我可以在Anaconda提示符中复制错误。
摘要
_ssl.pyd
C:\Users\username\AppData\Local\Continuum\anaconda3\DLLs
它确实可以工作,但是我缺少了一些东西,或者不知道如何进一步调试,以找出它在gitbash中不工作的原因。
我不明白如何调试python如何加载dll以及Anaconda环境如何影响这一点。