D
D
dasdasdsadas2022-02-16 17:00:57
Python
dasdasdsadas, 2022-02-16 17:00:57

Why windows does not find SSL certificates?

I am running the Python code below in the terminal:

google = "https://google.com"
a = requests.get(google)

I receive
spoiler
Traceback (most recent call last):
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 416, in connect
self.sock = ssl_wrap_socket(
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\MyPC\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "C:\MyPC\Programs\Python\Python310\lib\ssl.py", line 1070, in _create
self.do_handshake()
File "C:\MyPC\Programs\Python\Python310\lib\ssl.py", line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 440, in send
resp = conn.urlopen(
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "C:\MyPC\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url:

The problem is clearly with the SSL certificate, this problem occurs when accessing any site.
I also try heroku update (CLI update for Heroku service)
heroku: Updating CLI... !
Error: unable to verify the first certificate

The problem is the same. Apparently, something is wrong with the Windows setting. Tell me, what's the problem? I'm sitting in a regular network, I tried to change it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dasdasdsadas, 2022-03-27
@dasdasdsadas

All requests from Windows went through the corporate server, which, apparently, did not allow the Heroku certificate to be accepted

D
Drno, 2022-02-16
@Drno

What is Windows? there may be a problem with root certificates .. it was massive in early January, like ... or December

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question