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

- **ID:** `python/requests-sslerror-wrong-hostname`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server's SSL certificate is issued for a different hostname than the one being accessed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Use the correct hostname that matches the certificate's Common Name or Subject Alternative Names** (95% success)
   ```
   requests.get('https://correct-hostname.com')
   ```
2. **Provide the certificate via verify parameter if the server uses a custom CA** (85% success)
   ```
   requests.get('https://example.com', verify='/path/to/custom-ca.pem')
   ```

## Dead Ends

- **Setting verify=False to ignore SSL verification entirely** — Disabling SSL verification exposes the connection to man-in-the-middle attacks and does not solve the hostname mismatch for valid certificates. (70% fail)
- **Updating the requests library to the latest version** — The issue is not a library bug but a certificate configuration problem on the server side. (90% fail)
