通过 Twine 将 py 文件上传到代理服务器时出现 SSL 错误

SSL Errors when uploading py file to proxy server via Twine

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

我想将这些文件上传到Artifactory的代理服务器。我正在使用以下 twine 命令来完成它

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 in cpython (https://github.com/python/cpython/blob/master/Modules/_ssl.c)

中抱怨的那一行

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

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