首页 > 解决方案 > 通过 Twine 将 py 文件上传到代理服务器时出现 SSL 错误

问题描述

python setup.py sdist bdist_wheel我已经在 Ubuntu 机器上打包了一个 python 应用程序。

我想将这些文件上传到 Artifactory 的代理服务器。我正在使用以下麻线命令来做到这一点

twine upload --repository-url https://apro.example.net.au/api/pypi/example-python -u username -p password dist/* --client-cert /usr/lib/ssl/certs/my_cert.pem

当我运行命令时,出现以下错误 SSLError: HTTPSConnectionPool(host='apro.example.net.au', port=443): Max retries exceeded with url: /api/pypi/example-python (Caused by SSLError(SSLError(336265225, '[SSL] PEM lib (_ssl.c:2959)'),))

我已经放入my_certs.pem/usr/lib/ssl/certs/运行update-ca-certificates以确保证书是最新的。

当我试图弄清楚 SSLError 是什么时,我遇到了它在哪一行_ssl.c抱怨cpythonhttps://github.com/python/cpython/blob/master/Modules/_ssl.c

SSL_TLSEXT_ERR_OK确切是什么意思?我无法弄清楚证书有什么问题,因为它适用于我针对它运行的其他应用程序。

标签: pythonssl-certificatepypitwine

解决方案


原来我的 Artifactory 代理服务器存在证书问题


推荐阅读