giteapy
giteapy copied to clipboard
Use REQUESTS_CA_BUNDLE when set
What do you think of using the value of environment variable REQUESTS_CA_BUNDLE
for Configuration.ssl_ca_cert
by default ?
This is the variable used by urllib
, but since giteapy uses its configured value, the variable is not used.
+1 This is breaking SSL for me currently, because it is not using my custom CA
Just a quick update. The solution seemed to be a fairly simple hack to change what the certifi library considers your CA bundle. Since it defaults to its own local version inside a venv, I just had to manually point it to my system's bundle. Here's a method I just added to my own personal project just so you can see what I mean:
# Up top with all the other imports
import certifi
# Snippet method from a class not shown here
def set_ca_bundle(self, bundle_path: str):
self.__logger.info("Setting certificate bundle path")
# Hacky but oh well
self.__logger.info(f"Old path: {certifi.where()}")
certifi.core._CACERT_PATH = bundle_path
self.__logger.info(f"New path: {certifi.where()}")