gpt4 book ai didi

Python 3.2 Cherrypy 3.2.3 ssl_module pyopenssl 错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:53:51 24 4
gpt4 key购买 nike

我正在使用 Raspberry PiSSL 协议(protocol)和 Gandi 的签名证书 运行网络服务器。

服务器使用配置中的 ssl_module = 'builtin'。但是由于浏览器在识别证书颁发者方面存在问题,我需要通过 ssl_certificate_chain 属性提供中间证书,这只能通过使用 ssl_module = 'pyopenssl' .但是这个配置不起作用。 (查看错误信息)

ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0xe435b0>>
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/cherrypy/process/wspbus.py", line 205, in publish
output.append(listener(*args, **kwargs))
File "/usr/local/lib/python3.2/dist-packages/cherrypy/_cpserver.py", line 167, in start
self.httpserver, self.bind_addr = self.httpserver_from_self()
File "/usr/local/lib/python3.2/dist-packages/cherrypy/_cpserver.py", line 158, in httpserver_from_self
httpserver = _cpwsgi_server.CPWSGIServer(self)
File "/usr/local/lib/python3.2/dist-packages/cherrypy/_cpwsgi_server.py", line 60, in __init__
adapter_class = wsgiserver.get_ssl_adapter_class(ssl_module)
File "/usr/local/lib/python3.2/dist-packages/cherrypy/wsgiserver/wsgiserver3.py", line 1882, in get_ssl_adapter_class
adapter = ssl_adapters[name.lower()]
KeyError: 'pyopenssl'

[31/Jul/2015:16:04:18] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/cherrypy/process/wspbus.py", line 243, in start
self.publish('start')
File "/usr/local/lib/python3.2/dist-packages/cherrypy/process/wspbus.py", line 223, in publish
raise exc
cherrypy.process.wspbus.ChannelFailures: KeyError('pyopenssl',)

pyOpenSSL 已安装。但是当我做测试时:

'>>>import ssl

'>>>import socket

'>>>hasattr(socket, 'ssl')

False

我还尝试在使用 pip-3.2 安装 libssl-dev 后重建 Python3.2。但是我没有成功,不得不恢复整个系统。

感谢您的帮助!

最佳答案

至少对于几个 CherryPy 版本 ssl_builtin supports certificate_chain .从 Cheese Shop 安装 CherryPy 3.7+(即 pip install CherryPy),而不是从 Debian Pacakges。 Python 3.2 本身是一个很好的更新候选者(例如,许多库是 3.3+)。

另请查看 this answer了解当前的 CherryPy SSL 问题。或者 this section直接,因为 CherryPy 目前不支持 Python 3 的 PyOpenSSL。

关于Python 3.2 Cherrypy 3.2.3 ssl_module pyopenssl 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31749996/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com