OpenSSL.SSL.Error: certificate verify failed

A few days ago our circle CI builds started failing with the following error:

OpenSSL.SSL.Error: [(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)]

This happens whenever a connection is attempted over HTTPS. Has something changed in the build environment?

It seems to be specific to python.

What system are you connecting to? Is the certificate on that system valid?