Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.95 KB

[FIX] invalid_certs_nih_vpn.md

File metadata and controls

60 lines (38 loc) · 2.95 KB

Issue Description

Installing/updating conda or pypi packages via NIH VPN results in the HTTP 000 CONNECTION FAILED error. This is strange coz when I copy and paste the conda URL and pypi URLin my browser, I'm able to access it.

Conda Error

$ conda install -c conda-forge r-mumin
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/osx-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://conda.anaconda.org/conda-forge/osx-64'

PyPI Error

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

Working Solution

  1. Open up pypi.org on firefox and found the NIH certificate that was being used for verification.

Screen Shot 2022-01-24 at 2 55 24 PM

  1. Export the certificate to home directory, from KeyChain Access on Mac, in .pem format.

Screen Shot 2022-01-24 at 3 03 21 PM

Screen Shot 2022-01-24 at 2 53 02 PM

  1. For any pip/conda install commands, I use the --cert flag. For example - pip install --cert ~/NIH-DPKI-ROOT-1A.pem dcm2bids

"permanent"-ish fix

Adding the following line in my zshrc file saves me the trouble of specifying the --cert flag but that said I'm not sure what's causing the issue to begin with.

export REQUESTS_CA_BUNDLE=/Users/arshithab/NIH-DPKI-ROOT-1A.pem

Update [09/20/2022]

The above solutions didn't work while trying to install pycap over vpn (off campus). Here's the command that worked today:

pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pycap

References