SSL cert error fix on jupyter notebook

Safer way to add trusted API

Install certifi

$ pip install certifi

# find out the path
$ python -m  certifi

Export trusted cert of API url

  1. In Google Chrome, browse to the API url, e.g., https://api.openai.com/v1/engines
  2. Export the cert. e.g., browser address bar > Connection is secure > Certificate is valid > Certificate Viewer, Details > Export

Add cert to certifi.pem

  1. Open certifi.pem.
  2. Add the downloaded cert to the bottom

For example,

-----BEGIN CERTIFICATE-----
# cert signature
-----END CERTIFICATE-----
  1. Restart jupter notebook

Created 2024-01-04T14:33:41+08:00 · Edit