SSLError: [SSL: EE_KEY_TOO_SMALL] 在 Ubuntu 上启动 jupyter notebook 时 ee 密钥太小 (_ssl.c:4022) [英] SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022) on Ubuntu when starting jupyter notebook
问题描述
当我尝试通过 EC2 服务器在 Ubuntu 中启动我的 Jupyter Notebook 时遇到此问题.
I have this problem when I am trying to initiate my Jupyter Notebook in Ubuntu over the EC2 server.
SSLError: [SSL: EE_KEY_TOO_SMALL] ee 密钥太小 (_ssl.c:4022)
SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022)
原来我有
权限错误 [Errno 13]
permission error [Errno 13]
然后我关注了这个页面并通过将 /home
文件夹和 ~/.local/share/jupyter/
文件夹的所有权更改为当前用户来修复它.
then I followed this page and fixed it by changing the ownership of the /home
folder and ~/.local/share/jupyter/
folder to current user.
现在我遇到了 SSL 问题.我按照建议查看了这个链接,但没有运气.
Now I have the SSL issue. I checked out this link as suggested, but no luck.
然后我 cd
到我的 certs 文件夹,mycert.pem"
就在那里.而且我确定我用 "https://" 替换了本地主机 IP 地址.亚马逊网址
.
I then cd
to my certs folder, the "mycert.pem"
is there. And I am sure I replace the local host IP address with "https://" amazon url
.
我的错误代码似乎与此帖子不相似 也是,虽然我们的密钥都太小了.但是我的是"ee key"
,还有"_ssl.c:4022"
,和他们不一样.
My error code seems not similar to this post too, though we both have key too small. But mine is "ee key "
, and "_ssl.c:4022"
, which is different from them.
整个错误信息是这样的:
The entire error message is like this:
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 到您的 cert 文件夹,然后输入以下命令:
cd to your cert folder, and type this command:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem
你是对的,将你的 rsa 增加到 2048,这将解决你的问题.至少这解决了我的问题.
You are right, increase your rsa to 2048, this will solve your problem. At least this solved mine.
这篇关于SSLError: [SSL: EE_KEY_TOO_SMALL] 在 Ubuntu 上启动 jupyter notebook 时 ee 密钥太小 (_ssl.c:4022)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!