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

Cannot run with cooperate proxy #2

Open
vtdat opened this issue Nov 2, 2021 · 0 comments
Open

Cannot run with cooperate proxy #2

vtdat opened this issue Nov 2, 2021 · 0 comments

Comments

@vtdat
Copy link

vtdat commented Nov 2, 2021

newsreader-cli on  master via newsreader-cli 
➜ python3 -m newsreadercli main
Traceback (most recent call last):
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='vnexpress.net', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/vutuandat/Documents/github/newsreader-cli/newsreadercli/__main__.py", line 10, in <module>
    news_scrapper.default()
  File "/home/vutuandat/Documents/github/newsreader-cli/newsreadercli/scraper.py", line 39, in default
    self.page_scrape()                                  # Default values
  File "/home/vutuandat/Documents/github/newsreader-cli/newsreadercli/scraper.py", line 63, in page_scrape
    soup = self.make_soup(url, page)
  File "/home/vutuandat/Documents/github/newsreader-cli/newsreadercli/scraper.py", line 49, in make_soup
    page = requests.get(constants.BASE_URL if (url is None) else url).text
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/vutuandat/Documents/github/newsreader-cli/env/lib/python3.8/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='vnexpress.net', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)')))
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

1 participant