1

tornado https サーバーを起動すると、PEM パスワードの入力を求められます (これは設定していないので、Enter キーを押しただけです)。

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)

この問題の解決策が見つかりません。最新のtornadoバージョンとpython 2.7を使用しています

ありがとう!

4

1 に答える 1

2

そのページの指示に従った場合、キーにはまだパスワードがあり、空です。Python 2 でパスワード付きのキーを非対話的に使用できるかどうかはわかりません (このSSLContext.load_cert_chain方法は Python 3.2 で新しくなりました)。最初のステップで に変更-des3することにより (プロンプトを無効にする)、パスワードをまったく使用しないキーを作成できます: (その後、新しいキーに対して残りの手順を繰り返します)、または を使用して、作成したキーからパスワードを削除しますすでに取得済み ( http://www.mnxsolutions.com/apache/removing-a-passphrase-from-an-ssl-key.htmlを参照)-nodesopenssl genrsa -nodes -out www.thegeekstuff.com.key 1024openssl rsa

于 2013-10-17T18:43:27.893 に答える