Payam_2021
Payam_2021

Reputation: 19

I see a requests.exceptions.SSLError when working API calling from a site

My code:

import requests

url = 'https://hacker-news.firebaseio.com/v0/topstories.json'
r = requests.get(url)
print('Status code:', r.status_code)

and error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='hacker-news.firebaseio.com', port=443): Max retries exceeded with url: /v0/topstories.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)')))

What's the problem?

Upvotes: 0

Views: 900

Answers (1)

Conrad Lotz
Conrad Lotz

Reputation: 8818

There might be a larger network problem at play here causing this ssql error but to remedy this quicker do the following:

requests.get(url, verify=False)

You are bypassing the SSL for now.

Upvotes: 1

Related Questions