Skip to content

Instantly share code, notes, and snippets.

@th-yoo
Last active January 26, 2025 12:12
Show Gist options
  • Save th-yoo/eac6fa059c4287e03765fb1d3d04177d to your computer and use it in GitHub Desktop.
Save th-yoo/eac6fa059c4287e03765fb1d3d04177d to your computer and use it in GitHub Desktop.
SSLError: unable to get local issuer certificate (poetry 2.0 installed via pipx on macOS)

SSLError: unable to get local issuer certificate

$ poetry add git+https://github.com/th-yoo/niquests-ratelimiter.git

HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /th-yoo/niquests-ratelimiter.git/info/refs?service=git-upload-pack (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)')))

References

Install certifi

prerequisites

  • python is installed by brew
  • pipx is installed by brew
  • perplexity is installed by pipx
$ brew install certifi

get openssl ca file path

$ python3 -c "import ssl; print(ssl.get_default_verify_paths().openssl_cafile)"
/usr/local/etc/openssl@3/cert.pem

get certifi ca file path

$ python3 -c "import certifi; print(certifi.where())"
/usr/local/lib/python3.13/site-packages/certifi/cacert.pem

chage directory to the directory of openssl ca file

$ cd /usr/localetc/openssl@3

remove or rename cert.pem symbolic link

$ mv cert.pem cert.sav.pem

create symbolic link to the certifi ca file

$ ln -s '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem' cert.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment