Python SSL error

Extremely late to the party, but I am going to leave here a hotfix in case anyone else gets the same error…

The error is mostly due to a self-signing of the certificate passed to the request module, most likely due to some corporate proxy setting.

In this case, what can be done is download the root certificate of plot.ly manually (you can do that from google chrome by clicking on the ā€œSecureā€ icon:

secure

Once you have downloaded the certificate, you have to point to it.

To my knowledge, you cannot access the requests session that gets created by plotly. If that were possible, you could do session.verify=ā€˜path_to_cert’ and solve the issue.

In absence of that, you can set up an environment variable which will be accessed by requests by default. It’s messier but gets the job done:

import os
os.environ[ā€˜REQUESTS_CA_BUNDLE’] = ā€˜path to cer’

If you do this, you should be able to successfully pass SSL verification and the problem should go away.

1 Like