python network_error ai_generated partial

requests.exceptions.SSLError: HTTPSConnectionPool(host='expired.example.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired')))

ID: python/requests-sslerror-expired-certificate

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2025-03-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

The server's SSL certificate has expired and is no longer valid.

generic

中文

服务器的SSL证书已过期,不再有效。

Workarounds

  1. 95% success Renew the certificate on the server side
    Contact server administrator to renew the SSL certificate.
  2. 80% success Use a different endpoint or service that has a valid certificate
    requests.get('https://valid.example.com')

Dead Ends

Common approaches that don't work:

  1. Setting verify=False to bypass the error 60% fail

    Bypasses security but exposes to risks; does not fix the expired certificate.

  2. Using a custom CA bundle with the expired certificate 90% fail

    The certificate is expired, so it will still fail verification.