ubuntu - 启动 jupyter notebook 时在 Ubuntu 上出现 SSLError : [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl. c:4022)

标签 ubuntu ssl amazon-ec2 jupyter-notebook permissions

当我尝试通过 EC2 服务器在 Ubuntu 中启动我的 Jupyter Notebook 时,我遇到了这个问题。

SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022)


本来我有

permission error [Errno 13]


然后我跟着这个page并通过更改 /home 的所有权来修复它文件夹和 ~/.local/share/jupyter/文件夹到当前用户。
现在我遇到了 SSL 问题。我查看了这个 link正如建议的那样,但没有运气。
我然后cd到我的证书文件夹 "mycert.pem"在那儿。而且我确定我将本地主机 IP 地址替换为 "https://" amazon url .
我的错误代码似乎与 post 不相似也是,尽管我们俩的 key 都太小了。但我的是 "ee key " , 和 "_ssl.c:4022" ,这与他们不同。
整个错误信息是这样的:
ubuntu@ip-172-31-15-155:~$ jupyter notebook
[I 16:53:35.24 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 16:53:35.24 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 16:53:35.24 NotebookApp] https://ip-172-31-15-155:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322
[I 16:53:35.24 NotebookApp]  or https://127.0.0.1:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322
[I 16:53:35.25 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:53:35.28 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/ubuntu/.local/share/jupyter/runtime/nbserver-22585-open.html
    Or copy and paste one of these URLs:
        https://ip-172-31-15-155:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322
     or https://127.0.0.1:8888/?token=5d6f7e3d198847e0b9008cff94deb68355701d6c6c983322
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(4, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(4, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 276, in accept_handler
    callback(connection, address)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/tcpserver.py", line 288, in _handle_connection
    connection = ssl_wrap_socket(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 608, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 576, in ssl_options_to_context
    context.load_cert_chain(
ssl.SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022)
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(4, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(4, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 276, in accept_handler
    callback(connection, address)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/tcpserver.py", line 288, in _handle_connection
    connection = ssl_wrap_socket(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 608, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/netutil.py", line 576, in ssl_options_to_context
    context.load_cert_chain(
ssl.SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022)

最佳答案

cd 到您的证书文件夹,然后键入以下命令:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem
你是对的,将你的 rsa 增加到 2048,这将解决你的问题。至少这解决了我的问题。

关于ubuntu - 启动 jupyter notebook 时在 Ubuntu 上出现 SSLError : [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl. c:4022),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67753969/

相关文章:

ruby-on-rails - CPU利用率问题

python - Django 中的线程在生产环境中不起作用

linux - EC2 中的 apt 命令采用了错误的版本

apache - 已安装 Hive 但运行时出错

带有 OpenMP 的 C++ 尽量避免紧密循环数组的错误共享

apache - 如果请求来自特定主机,则特定 URL 重定向到 http

ubuntu - 在 Ubuntu 中构建 llvm 源代码的 fatal error

docker - X509 : certfificate signed by unknown authority when using docker login from a remote machine

java - java NIO SSO 处理器中的空指针

amazon-ec2 - 在 Amazon EC2 和 VPS 之间进行选择时需要一些帮助