Certificate verification failed

We’re sometimes getting a “httpx._exceptions.NetworkError: certificate verification failed (_ssl.c:2607)” error when trying to get data from a URL of the form https://<PRISMIC_REPO>.cdn.prismic.io/api/v2

Has anyone seen anything similar or any idea what could be causing this?

The only thing I could myself guess could cause this would be some sort of issue with the SSL/TLS certificate on one or a few of the servers hosting the CDN. However at least a full scan by https://www.ssllabs.com/ssltest/analyze.html couldn’t find any issue. And to make things harder this seems to happen really rarely.

I’ve now temporarily added a retry loop so that it’ll just retry a few times if it fails, but would be nice to figure out what the real reason is.

We’ve built our own integration using Python and the httpx library (version 0.12.1); not that I think it likely matters that much based on the error message. Neither do I think the trace will help, but posting it as well for completeness.

httpx._exceptions.NetworkError: certificate verification failed (_ssl.c:2607)
at as_network_error (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_utils.py:368)
at exit (/usr/local/lib/python3.8/contextlib.py:131)
at read (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_backends/asyncio.py:130)
at _receive_event (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/http11.py:174)
at _receive_response (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/http11.py:127)
at send (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/http11.py:52)
at send (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/connection.py:44)
at send (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/connection_pool.py:153)
at send (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_dispatch/connection_pool.py:157)
at send_single_request (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1196)
at send_handling_auth (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1170)
at send_handling_redirects (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1133)
at send (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1106)
at request (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1085)
at get (/.venv/backend-XIEYiin6-py3.8/lib/python3.8/site-packages/httpx/_client.py:1224)
…(references to our own code)

Hi Joakim,

Welcome to the Prismic community, I will try to help you on this.
In fact I didn’t face such an issue before, but I will create a ticket in our issue tracker so that our dev team have a look at this.

To do so, can you please provide Prismic repository that are having the issue with as well as the exact timestamp of the exception.

Looking forward to your reply,
Fares

This issue has been closed due to inactivity.