【问题标题】:Tornado https ssl error龙卷风 https ssl 错误
【发布时间】:2013-10-26 03:07:06
【问题描述】:

当我启动我的 tornado https 服务器时,我被要求输入 PEM 密码(我没有设置,所以我直接回车)

Enter PEM pass phrase: 2013-10-17 14:24:46,730 ioloop.py:660 Exception
in I/O handler for fd 3 Traceback (most recent call last):   File
"/usr/lib/python2.7/site-packages/tornado/ioloop.py", line 653, in
start
    self._handlers[fd](fd, events)   File "/usr/lib/python2.7/site-packages/tornado/stack_context.py", line 241,
in wrapped
    callback(*args, **kwargs)   File "/usr/lib/python2.7/site-packages/tornado/netutil.py", line 141, in
accept_handler
    callback(connection, address)   File "/usr/lib/python2.7/site-packages/tornado/tcpserver.py", line 212, in
_handle_connection
    do_handshake_on_connect=False)   File "/usr/lib/python2.7/site-packages/tornado/netutil.py", line 322, in
ssl_wrap_socket
    return ssl.wrap_socket(socket, **dict(context, **kwargs))   File "/usr/lib64/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)   File "/usr/lib64/python2.7/ssl.py", line 141, in __init__
    ciphers) SSLError: [Errno 336265225] _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib Enter
PEM pass phrase:

我使用以下说明生成了密钥:http://www.thegeekstuff.com/2009/07/linux-apache-mod-ssl-generate-key-csr-crt-file/ 然后修改龙卷风旋转如下

SSL_OPTIONS = {
    "certfile": "path/to/crt",
    "keyfile": "path/to/private/key", } 
https_server = tornado.httpserver.HTTPServer(application, ssl_options=SSL_OPTIONS)

我找不到任何解决此问题的方法。我正在使用最新的龙卷风版本和 python 2.7

谢谢!

【问题讨论】:

标签: python ssl https ssl-certificate tornado


【解决方案1】:

如果您按照该页面上的说明进行操作,您的密钥仍然有密码,只是为空。我不确定是否可以在 Python 2 中以非交互方式使用带有密码的密钥(SSLContext.load_cert_chain 方法是 Python 3.2 中的新方法)。您可以通过在第一步中将-des3 更改为-nodes 来创建根本没有密码的密钥(这将禁用提示):openssl genrsa -nodes -out www.thegeekstuff.com.key 1024(然后对新密钥重复其余步骤),或使用@ 987654327@ 从您已经获得的密钥中删除密码(请参阅http://www.mnxsolutions.com/apache/removing-a-passphrase-from-an-ssl-key.html

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-08-02
  • 2013-08-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多