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

Exception of CDN's SSL expiring is not handled #2

Open
bluems opened this issue May 2, 2024 · 0 comments
Open

Exception of CDN's SSL expiring is not handled #2

bluems opened this issue May 2, 2024 · 0 comments

Comments

@bluems
Copy link

bluems commented May 2, 2024

My guess is that the project acquires files for offline use from the CDN specified in the user's FASTAPI.
I am getting the error below, I am not able to clone the files from the CDN the same as FASTAPI.
This project needs an option to change or specify the CDN.

$ pip3 install git+https://github.com/ahmetoner/fastapi-offline-swagger-ui
Collecting git+https://github.com/ahmetoner/fastapi-offline-swagger-ui
  Cloning https://github.com/ahmetoner/fastapi-offline-swagger-ui to /tmp/pip-req-build-9jhvtiem
  Running command git clone -q https://github.com/ahmetoner/fastapi-offline-swagger-ui /tmp/pip-req-build-9jhvtiem
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-9jhvtiem/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-9jhvtiem/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-9jhvtiem/pip-egg-info
         cwd: /tmp/pip-req-build-9jhvtiem/
    Complete output (46 lines):
    Traceback (most recent call last):
      File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
        h.request(req.get_method(), req.selector, req.data, headers,
      File "/usr/lib/python3.8/http/client.py", line 1256, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
        self.send(msg)
      File "/usr/lib/python3.8/http/client.py", line 951, in send
        self.connect()
      File "/usr/lib/python3.8/http/client.py", line 1425, in connect
        self.sock = self._context.wrap_socket(self.sock,
      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 1069, in _create
        self.do_handshake()
      File "/usr/lib/python3.8/ssl.py", line 1338, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-9jhvtiem/setup.py", line 30, in <module>
        install_requires=download_cdn_files(),
      File "/tmp/pip-req-build-9jhvtiem/setup.py", line 14, in download_cdn_files
        urlretrieve(cdn_url, static_path / cdn_url.split("/")[-1])
      File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
        with contextlib.closing(urlopen(url, data)) as fp:
      File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
        return opener.open(url, data, timeout)
      File "/usr/lib/python3.8/urllib/request.py", line 525, in open
        response = self._open(req, data)
      File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
        result = self._call_chain(self.handle_open, protocol, protocol +
      File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
        result = func(*args)
      File "/usr/lib/python3.8/urllib/request.py", line 1397, in https_open
        return self.do_open(http.client.HTTPSConnection, req,
      File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
        raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
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