I have the following error. How to fix the following certificate error (ipython)?

和自甴很熟 提交于 2019-12-20 04:12:58

问题


I'm getting the following error when I want to run ipython notebook on my macbook. Does anyone know how to fix this? Could you please help me about it?

ERROR:root:Exception in I/O handler for fd 6
Traceback (most recent call last):
  File "//anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start
    self._handlers[fd](fd, events)
  File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 167, in accept_handler
    callback(connection, address)
  File "//anaconda/lib/python2.7/site-packages/tornado/tcpserver.py", line 217, in _handle_connection
    do_handshake_on_connect=False)
  File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 407, in ssl_wrap_socket
    return ssl.wrap_socket(socket, **dict(context, **kwargs))
  File "//anaconda/python.app/Contents/lib/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)
  File "//anaconda/python.app/Contents/lib/python2.7/ssl.py", line 141, in __init__
    ciphers)
SSLError: [Errno 336445449] _ssl.c:368: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib
ERROR:root:Exception in I/O handler for fd 6
Traceback (most recent call last):
  File "//anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start
    self._handlers[fd](fd, events)
  File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 167, in accept_handler
    callback(connection, address)
  File "//anaconda/lib/python2.7/site-packages/tornado/tcpserver.py", line 217, in _handle_connection
    do_handshake_on_connect=False)
  File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 407, in ssl_wrap_socket
    return ssl.wrap_socket(socket, **dict(context, **kwargs))
  File "//anaconda/python.app/Contents/lib/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)
  File "//anaconda/python.app/Contents/lib/python2.7/ssl.py", line 141, in __init__
    ciphers)
SSLError: [Errno 336445449] _ssl.c:368: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib

回答1:


It appears that your browser is attempting to access the notebook without SSL. Make sure to access the site with HTTPS. For example, when you access the notebook, type in https://127.0.0.1:9999 in your browser. (Or whatever the address of the server is.)




回答2:


It doesn't recognise the files you're passing it - either:

  1. pass a .pem file (private key) to --NotebookApp.keyfile= and the .crt file (your certificate) to --NotebookApp.certfile=
  2. create a new file by appending your certificate to your key and pass this new file to --certfile.


来源:https://stackoverflow.com/questions/23146662/i-have-the-following-error-how-to-fix-the-following-certificate-error-ipython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!