[Python] TLS Verification Error (x509: certificate signed by unknown authority) with...

Discussão em 'Python' iniciado por Stack, Fevereiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    I’m trying to use tls_client in Python to access https://www.google.com/ through a Bright Data residential proxy, but I keep getting an SSL verification error: tls: failed to verify certificate: x509: “*.google.com” certificate is not standards compliant. I want to either fix the SSL issue or safely bypass verification to make this work.

    My Code


    from tls_client import Session

    proxy = "http://brd-customer-hl_37d678eb-zone-residential_proxy1:nbm6n6cp6qir@brd.superproxy.io:33335"
    session = Session(client_identifier="chrome_114")
    session.proxies = {"http": proxy, "https": proxy}

    try:
    response = session.get("https://www.google.com/")
    print(response.status_code)
    except Exception as e:
    print(f"Error: {str(e)}")

    Output


    Error: failed to do request: Get "https://www.google.com/": tls: failed to verify certificate: x509: “*.google.com” certificate is not standards compliant

    Details

    • Python: 3.10
    • tls_client version: [run pip show tls_client and add it here, e.g., 0.1.8]
    • OS: macOS
    • Proxy: Bright Data residential proxy (http://brd-customer-hl_37d678eb-zone-residential_proxy1:nbm6n6cp6qir@brd.superproxy.io:33335)
    What I Tried

    1. Setting session.verify_ssl = False—no effect, same error.
    2. Using session.get(..., insecure=True)—fails with TypeError: get() got an unexpected keyword argument 'insecure'.
    3. Tested the proxy with requests and verify=False—it works fine, but I need tls_client for its TLS fingerprinting.

    Continue reading...

Compartilhe esta Página