0

i get this error requests.exceptions.SSLError: HTTPSConnectionPool(host='ipinfo.io', port=443): Max retries exceeded with url: /json (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)')))

This is my code :

import requests
 
proxy_servers = {
    'https': 'https://103.97.177.12:7890',
}
 
response = requests.get('https://ipinfo.io/json',
                        proxies=proxy_servers, verify=False)
 
 
print(response.json()['country'])
print(response.json()['region'])

I was trying to connect to a proxy server using a python code.

3
  • What does the proxy's documentation say about the error? If the proxy has an access log, you should should check it for repeat requests. But if I'm reading it correctly, the error is from the proxy failing to connect to the destination. You should test that URL directly from the proxy (not from your script's system). Also, you should add some error handling in your code, and include it in the question, since this is, after all StackOverflow, and not ServerFault :) Commented Feb 26, 2023 at 21:37
  • Well the code is from a youtube tutorial, so it wokrs fine but after a research i found out that my isp blocks proxies and i needed a remote desktop server. Thanks tho for the effort. <3 Commented Mar 1, 2023 at 0:12
  • SSL proxy should look like any SSL connection, so they might be blocking in a very specific way. If you are just practicing, I've been answering a pile of proxy-connection failure questions, some people have tutorials where the proxy is setup on localhost. If you did that lesson plan, you can proxy-yourself. :) Commented Mar 1, 2023 at 5:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.