Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSLError #16

Open
ghost opened this issue Mar 9, 2023 · 0 comments
Open

SSLError #16

ghost opened this issue Mar 9, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2023

I keep getting this error while running top or search.

Running in windows10 and jupyter notebook.


SSLCertVerificationError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
702 # Make the request on the httplib connection object.
--> 703 httplib_response = self._make_request(
704 conn,

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
385 try:
--> 386 self._validate_conn(conn)
387 except (SocketTimeout, BaseSSLError) as e:

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in _validate_conn(self, conn)
1041 if not getattr(conn, "sock", None): # AppEngine might not have .sock
-> 1042 conn.connect()
1043

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py in connect(self)
413
--> 414 self.sock = ssl_wrap_socket(
415 sock=conn,

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
448 if send_sni:
--> 449 ssl_sock = _ssl_wrap_socket_impl(
450 sock, context, tls_in_tls, server_hostname=server_hostname

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\ssl_.py in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
492 if server_hostname:
--> 493 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
494 else:

C:\ProgramData\Anaconda3\lib\ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
500 # ctx._wrap_socket()
--> 501 return self.sslsocket_class._create(
502 sock=sock,

C:\ProgramData\Anaconda3\lib\ssl.py in _create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
1040 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1041 self.do_handshake()
1042 except (OSError, ValueError):

C:\ProgramData\Anaconda3\lib\ssl.py in do_handshake(self, block)
1309 self.settimeout(None)
-> 1310 self._sslobj.do_handshake()
1311 finally:

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

MaxRetryError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
488 if not chunked:
--> 489 resp = conn.urlopen(
490 method=request.method,

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
786
--> 787 retries = retries.increment(
788 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
591 if new_retry.is_exhausted():
--> 592 raise MaxRetryError(_pool, url, error or ResponseError(cause))
593

MaxRetryError: HTTPSConnectionPool(host='www.1337x.to', port=443): Max retries exceeded with url: /top-100 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

SSLError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_1228\2343003185.py in
----> 1 torrents.top()

~\AppData\Roaming\Python\Python39\site-packages\py1337x\py1337x.py in top(self, category)
41 url = f"{self.baseUrl}/top-100{'-'+category if category else ''}"
42
---> 43 response = self.requests.get(url, headers=self.headers)
44 return parser.torrentParser(response, baseUrl=self.baseUrl)
45

~\AppData\Roaming\Python\Python39\site-packages\requests_cache\session.py in get(self, url, params, **kwargs)
101 def get(self, url: str, params=None, **kwargs) -> AnyResponse: # type: ignore
102 kwargs.setdefault('allow_redirects', True)
--> 103 return self.request('GET', url, params=params, **kwargs)
104
105 def options(self, url: str, **kwargs) -> AnyResponse: # type: ignore

~\AppData\Roaming\Python\Python39\site-packages\requests_cache\session.py in request(self, method, url, headers, expire_after, only_if_cached, refresh, force_refresh, *args, **kwargs)
157 headers = set_request_headers(headers, expire_after, only_if_cached, refresh, force_refresh)
158 with patch_form_boundary() if kwargs.get('files') else nullcontext():
--> 159 return super().request(method, url, *args, headers=headers, **kwargs) # type: ignore
160
161 def send(

C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
585 }
586 send_kwargs.update(settings)
--> 587 resp = self.send(prep, **send_kwargs)
588
589 return resp

~\AppData\Roaming\Python\Python39\site-packages\requests_cache\session.py in send(self, request, expire_after, only_if_cached, refresh, force_refresh, **kwargs)
204 response = self._resend(request, actions, cached_response, **kwargs) # type: ignore
205 elif actions.send_request:
--> 206 response = self._send_and_cache(request, actions, cached_response, **kwargs)
207 else:
208 response = cached_response # type: ignore # Guaranteed to be non-None by this point

~\AppData\Roaming\Python\Python39\site-packages\requests_cache\session.py in _send_and_cache(self, request, actions, cached_response, **kwargs)
228 """
229 request = actions.update_request(request)
--> 230 response = super().send(request, **kwargs)
231 actions.update_from_response(response)
232

C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py in send(self, request, **kwargs)
699
700 # Send the request
--> 701 r = adapter.send(request, **kwargs)
702
703 # Total elapsed time of the request (approximately)

C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
561 if isinstance(e.reason, _SSLError):
562 # This branch is for urllib3 v1.22 and later.
--> 563 raise SSLError(e, request=request)
564
565 raise ConnectionError(e, request=request)

SSLError: HTTPSConnectionPool(host='www.1337x.to', port=443): Max retries exceeded with url: /top-100 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants