Search code examples
pythonssl-certificatepypitwine

SSL Errors when uploading py file to proxy server via Twine


I have packaged up a python application using python setup.py sdist bdist_wheelon an Ubuntu machine.

I want to upload these files to a proxy server of Artifactory. I am using the following twine command to do it

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

When I run the command I am getting the following error 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)'),))

I have placed my my_certs.pem into /usr/lib/ssl/certs/ and ran update-ca-certificates to make sure the certificates are up to date.

When I was trying to figure out what the SSLError was I came across what line it was complaining in _ssl.c in cpython (https://github.com/python/cpython/blob/master/Modules/_ssl.c)

What does SSL_TLSEXT_ERR_OK exact mean? I cannot figure out what is wrong with the certificate as it works fine with other applications I run against it.


Solution

  • Turns out my proxy server of Artifactory was having issues with certificates