尝试在linux启动时运行一个cherrypy https服务器。启动脚本适用于运行http的cherrypy,但不适用于https。此外,当手动运行https服务器时它工作,因此没有库问题。摘要和错误如下:
我将https启动脚本的结果输出到文本文件,并遇到此错误:
[25/Feb/2015:13:59:03] ENGINE Bus STARTING
[25/Feb/2015:13:59:03] ENGINE Started monitor thread '_TimeoutMonitor'.
[25/Feb/2015:13:59:03] ENGINE Started monitor thread 'Autoreloader'.
[25/Feb/2015:13:59:03] ENGINE Serving on 0.0.0.0:8099
[25/Feb/2015:13:59:03] ENGINE Bus STARTED
[25/Feb/2015:13:59:03] ENGINE Error in HTTPServer.tick
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1837, in start
self.tick()
File "/usr/local/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1902, in tick
s, ssl_env = self.ssl_adapter.wrap(s)
File "/usr/local/lib/python2.7/site-packages/cherrypy/wsgiserver/ssl_builtin.py", line 52, in wrap
keyfile=self.private_key, ssl_version=ssl.PROTOCOL_SSLv23)
File "/usr/local/lib/python2.7/ssl.py", line 387, in wrap_socket
ciphers=ciphers)
File "/usr/local/lib/python2.7/ssl.py", line 141, in __init__
ciphers)
SSLError: [Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
我将包含脚本的文件夹的权限设置为“chmod 777”,即向所有用户/组授予所有权限。没运气。
答案 0 :(得分:2)
您最有可能设置证书的相对路径,或者它可能没有读取权限。
仔细检查证书的路径。使用绝对值并注意任何所需的转义字符。 \
答案 1 :(得分:0)
修正了解决方案,cyraxjoe是对的。它最终是init.d脚本从etc / init.d /运行python服务器文件,私钥文件使用相对路径。使用绝对路径最终解决了问题。
感谢!!!