Enhanced logic for setting SSL_CERT_FILE and REQUESTS_CA_BUNDLE

This commit is contained in:
Brian Zalewski 2023-08-18 00:30:29 -04:00 committed by GitHub
parent ae8dd3841a
commit 5df352de06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,12 +152,6 @@ fi
# BW_CLIENTID client_id # BW_CLIENTID client_id
# BW_CLIENTSECRET # BW_CLIENTSECRET
### CA Certificate
# Used by Python, cURL, and other tools
export CERT_PATH="$HOME/.local/etc/ssl/curl/cacert.pem"
export SSL_CERT_FILE="$CERT_PATH"
export REQUESTS_CA_BUNDLE="$CERT_PATH"
### Cheat ### Cheat
if command -v fzf > /dev/null; then if command -v fzf > /dev/null; then
export CHEAT_USE_FZF=true export CHEAT_USE_FZF=true
@ -358,13 +352,17 @@ export PATH="$PATH:$PNPM_HOME"
# Specify location of the default Prettierd configuration # Specify location of the default Prettierd configuration
# export PRETTIERD_DEFAULT_CONFIG="" # export PRETTIERD_DEFAULT_CONFIG=""
### Python ### Python / CA Certificate
# Replaced by certificate retrieved from the cURL website # Used by Python, cURL, and other tools
# if command -v python3 > /dev/null; then if [ -f "$HOME/.local/etc/ssl/curl/cacert.pem" ]; then
# export CERT_PATH="$(python3 -m certifi)" export CERT_PATH="$HOME/.local/etc/ssl/curl/cacert.pem"
# export SSL_CERT_FILE="$CERT_PATH" export SSL_CERT_FILE="$CERT_PATH"
# export REQUESTS_CA_BUNDLE="$CERT_PATH" export REQUESTS_CA_BUNDLE="$CERT_PATH"
# fi elif command -v python3 > /dev/null; then
export CERT_PATH="$(python3 -m certifi)" || export CERT_PATH="$(python -m certifi)"
export SSL_CERT_FILE="$CERT_PATH"
export REQUESTS_CA_BUNDLE="$CERT_PATH"
fi
### Readline ### Readline
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/readline/inputrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/readline/inputrc"