0

How can i fix this problem? I run this script on windows

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1037, in _send_output
    self.send(msg)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 975, in send
    self.connect()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1071, in _create
    self.do_handshake()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1342, 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:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyngrok\installer.py", line 117, in install_ngrok
    download_path = _download_file(url, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyngrok\installer.py", line 261, in _download_file
    response = urlopen(url, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 519, in open
    response = self._open(req, data)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [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:\Users\Administrator\Desktop\1\bot.py", line 136, in <module>
    ngrok.set_auth_token(cache['raw_config']['ngrok_token'])
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyngrok\ngrok.py", line 135, in set_auth_token
    install_ngrok(pyngrok_config)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyngrok\ngrok.py", line 100, in install_ngrok
    installer.install_ngrok(pyngrok_config.ngrok_path, pyngrok_config.ngrok_version)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyngrok\installer.py", line 121, in install_ngrok
    raise PyngrokNgrokInstallError("An error occurred while downloading ngrok from {}: {}".format(url, e))
pyngrok.exception.PyngrokNgrokInstallError: An error occurred while downloading ngrok from https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-windows-amd64.zip: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
Press key to exit.

I try to reinstall pyngrok and nothing changed

Ajeet Verma
  • 2,938
  • 3
  • 13
  • 24
Joff
  • 1
  • 1
    Welcome to Stack Overflow. Just by posting the error, it is not often sufficient to know what your issue is. You need to also include your code as well as an explanation of what you are doing. While it is stating you are connecting to a site that is using a self-signed certificate, I'm not convinced that is the correct conclusion. Are you using some sort of proxy? – ewokx Apr 27 '23 at 02:00
  • Does this answer your question? https://github.com/alexdlaird/pyngrok/issues/93#issuecomment-945019968 – alexdlaird Apr 27 '23 at 02:29

0 Answers0