PWZER / swagger-ui-py

Swagger UI for Python web framework, such Tornado, Flask and Sanic. https://pwzer.github.io/swagger-ui-py/
https://pypi.org/project/swagger-ui-py
Apache License 2.0
68 stars 31 forks source link

Support for self-signed certificate #17

Closed mcrozes closed 4 years ago

mcrozes commented 4 years ago

Hey -

Is there a way for swagger-UI to support self-signed/local SSL certificates (aka request.get(xxx,verify=False) ?

This is the error I am getting when trying to deploy my API

File .../python3.7/site-packages/swagger_ui/core.py", line 75, in get_config
    with urllib.request.urlopen(self._config_url) as config_file:
  File ".../python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File ".../python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File ".../python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "...//urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "...//python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File ".../python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1051)>
mcrozes commented 4 years ago

Nvm, something was wrong on my side.