{"id":"596ad64fddd2664e","repo":"pypa/pip","slug":"ssl-verification-failed","errorCode":"ssl-verification-failed","errorMessage":"Failed to establish a secure connection to {host} while fetching {url}","messagePattern":"Failed to establish a secure connection to (.+?) while fetching (.+?)","errorType":"exception","errorClass":"SSLVerificationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/network/utils.py","lineNumber":180,"sourceCode":"    Note: requests.ConnectionError is the parent class of\n          requests.ProxyError, requests.SSLError, and requests.ConnectTimeout\n          so these errors are also handled here.\n    \"\"\"\n    url = redact_auth_from_url(url)\n    raw_hostname = urlsplit(url).hostname or urlsplit(url).netloc\n    reason = error.args[0] if error.args else error\n\n    # NewConnectionError is a subclass of TimeoutError for some reason...\n    if isinstance(reason, urllib3.exceptions.TimeoutError) and not isinstance(\n        reason, urllib3.exceptions.NewConnectionError\n    ):\n        # A bare timeout error can occur during non-streamed responses. Don't\n        # ask me how.\n        _raise_timeout_error(reason, url, raw_hostname, timeout)\n    if isinstance(reason, urllib3.exceptions.SSLError):\n        # A bare SSL error can occur during non-streamed responses, after the\n        # initial connection and TLS handshake have completed.\n        raise SSLVerificationError(url, raw_hostname, reason)\n\n    # At this point, all errors should be wrapped in MaxRetryError.\n    if not isinstance(reason, urllib3.exceptions.MaxRetryError):\n        raise ConnectionFailedError(url, raw_hostname, reason)\n\n    max_retry_error = reason\n    assert isinstance(max_retry_error.pool, urllib3.connectionpool.HTTPConnectionPool)\n    host = max_retry_error.pool.host\n    proxy = max_retry_error.pool.proxy\n    # Narrow the reason further to the specific error from the last retry.\n    reason = max_retry_error.reason\n\n    if isinstance(reason, urllib3.exceptions.SSLError):\n        raise SSLVerificationError(url, host, reason)\n    if isinstance(reason, urllib3.exceptions.TimeoutError) and not isinstance(\n        reason, urllib3.exceptions.NewConnectionError\n    ):\n        _raise_timeout_error(reason, url, host, timeout)","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/network/utils.py#L162-L198","documentation":"Error \"Failed to establish a secure connection to {host} while fetching {url}\" thrown in pypa/pip.","triggerScenarios":"Thrown at src/pip/_internal/network/utils.py:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}