shaare.it

requests.exceptions.SSLError: tlsv1 alert protocol version

7 Dec 2025

1 min read

SSLError: tlsv1 alert protocol version

$ python -c "import requests; requests.get('https://tls12-only.example.com')"
Traceback (most recent call last):
  ...
requests.exceptions.SSLError: tlsv1 alert protocol version

Why this happens

Server requires newer TLS (e.g., TLS 1.2+) than the client supports.

Fix

Update Python/OpenSSL/Requests stack or use a server that supports the client’s TLS.

Wrong code

import requests
requests.get('https://tls12-only.example.com')  # with outdated OpenSSL

Fixed code

import requests
requests.get('https://example.com')  # after updating environment