pypa / twine

Utilities for interacting with PyPI

Home Page:https://twine.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support environment variables to set Certificate

kleinjoshuaa opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

environment variable ssl certificate

Please describe the problem you are attempting to solve with this request

I work at a company that uses a DLP tool that essentially MITM's all of my traffic. This means I have to pass a custom cert ( twine <cmd> --cert /path/to/cert) to twine each time I run a twine command.

Many other tools let me set an environment variable that would let me put this in my bashrc so I could set it once and not have to remember again.

How do you think we should solve this?

Just support some environment variables to update this setting. Thank you

Anything else you'd like to mention?

No response

This does actually already support it in the same way as pip through REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE. I believe Python also respects all the default OpenSSL environment variables as well

Interesting - I am on a mac and I do not see that behavior - eg - I do have REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE set as env vars and I get SSL errors when I run twine without the --cert arg. When I use the --cert I do not. Doesn't twine use urllib and not requests?

We do use requests. I'm not sure why those aren't being picked up for you. We do also support TWINE_CERT which I had forgotten about