首页 > 解决方案 > ssl_options Jupyter Notebook 中缺少密钥“certfile”

问题描述

这是说我错过了密钥,但我已经创建了一个自签名并将其设置为绝对路径按照此处的教程:https ://jupyter-notebook.readthedocs.io/en/stable/public_server.html#using-lets -加密

我还尝试使用 .key 和 .crt 扩展名重新制作密钥,但仍然没有区别

## The full path to a private key file for usage with SSL/TLS.
#  Default: ''
c.NotebookApp.keyfile = u'/home/jupyter/Jupyter/notebook/0_repo/nb-privkey.pem'

# The full path to an SSL/TLS certificate file.
#  Default: ''
# c.NotebookApp.certfile = u'/home/jupyter/Jupyter/notebook/0_repo/nb-cert.pem'

(notebook) [jupyter@tf notebook]$ jupyter notebook
Traceback (most recent call last):
  File "/home/jupyter/Jupyter/notebook/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/jupyter_core/application.py", line 254, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/traitlets/config/application.py", line 844, in launch_instance
    app.initialize(argv)
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/notebook/notebookapp.py", line 2124, in initialize
    self.init_webapp()
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/notebook/notebookapp.py", line 1790, in init_webapp
    self.http_server = httpserver.HTTPServer(self.web_app, ssl_options=ssl_options,
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/tornado/util.py", line 288, in __new__
    instance.initialize(*args, **init_kwargs)
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/tornado/httpserver.py", line 187, in initialize
    TCPServer.__init__(
  File "/home/jupyter/Jupyter/notebook/lib/python3.9/site-packages/tornado/tcpserver.py", line 130, in __init__
    raise KeyError('missing key "certfile" in ssl_options')
KeyError: 'missing key "certfile" in ssl_options'

标签: pythonpython-3.xjupyter-notebookopensslvps

解决方案


推荐阅读