无法下载带有pip bookstack-dl的BookStack页面,且SSL证书错误

我尝试使用bookstack-dl 0.1.1下载Wiki书库的每一页。我的配置与

一样简单

dl.py

from bookstack_dl import BookstackAPI

# Initiate and log in.
bs = BookstackAPI("https://mywiki.it","user@gmail.com","T2iB5uc")

# kick off gathering meta data
bs.get_all_books()

# download all
bs.download_all("wiki")

但是,当我发出python3 dl.py时,它使用SSL返回了以下错误,如下所示:

Traceback (most recent call last):
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py",line 488,in wrap_socket
    cnx.do_handshake()
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py",line 1808,in do_handshake
    self._raise_ssl_error(self._ssl,result)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py",line 1548,in _raise_ssl_error
    _raise_current_error()
  File "/usr/lib/python3/dist-packages/OpenSSL/_util.py",line 54,in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines','tls_process_server_certificate','certificate verify failed')]

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",line 677,in urlopen
    chunked=chunked,File "/home/narun/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",line 381,in _make_request
    self._validate_conn(conn)
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",line 976,in _validate_conn
    conn.connect()
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/connection.py",line 370,in connect
    ssl_context=context,File "/home/narun/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py",line 377,in ssl_wrap_socket
    return context.wrap_socket(sock,server_hostname=server_hostname)
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py",line 494,in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines','certificate verify failed')],)",)

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/home/narun/.local/lib/python3.6/site-packages/requests/adapters.py",line 449,in send
    timeout=timeout
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",line 725,in urlopen
    method,url,error=e,_pool=self,_stacktrace=sys.exc_info()[2]
  File "/home/narun/.local/lib/python3.6/site-packages/urllib3/util/retry.py",line 439,in increment
    raise MaxRetryError(_pool,error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mywiki.it',port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines',),))

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "wiki/dl.py",line 7,in <module>
    bs.get_all_books()
  File "/home/narun/.local/lib/python3.6/site-packages/bookstack_dl/__init__.py",line 119,in get_all_books
    self.__get_session()
  File "/home/narun/.local/lib/python3.6/site-packages/bookstack_dl/__init__.py",line 70,in __get_session
    token_resp = book_sess.get(self.url)
  File "/home/narun/.local/lib/python3.6/site-packages/requests/sessions.py",line 543,in get
    return self.request('GET',**kwargs)
  File "/home/narun/.local/lib/python3.6/site-packages/requests/sessions.py",line 530,in request
    resp = self.send(prep,**send_kwargs)
  File "/home/narun/.local/lib/python3.6/site-packages/requests/sessions.py",line 643,in send
    r = adapter.send(request,**kwargs)
  File "/home/narun/.local/lib/python3.6/site-packages/requests/adapters.py",line 514,in send
    raise SSLError(e,request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='mywiki.it',))

注意:我的网站使用来自COMODO CA Limited的证书。

这是怎么了?我该如何解决?谢谢

baoqiwen123456 回答:无法下载带有pip bookstack-dl的BookStack页面,且SSL证书错误

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2403767.html

大家都在问