Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 940914 - net-p2p/deluge-2.1.1-r5: deluged error for RPC with short keys (1024 bits) since OpenSSL version 3.3.2
Summary: net-p2p/deluge-2.1.1-r5: deluged error for RPC with short keys (1024 bits) si...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Paolo Pedroni
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-05 21:04 UTC by Thibaud CANALE
Modified: 2024-10-06 20:52 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info dev-libs/openssl dev-python/pyopenssl net-p2p/deluge (file_940914.txt,10.17 KB, text/plain)
2024-10-05 21:04 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud CANALE 2024-10-05 21:04:39 UTC
Created attachment 904946 [details]
emerge --info dev-libs/openssl dev-python/pyopenssl net-p2p/deluge

Deluge bittorrent client is unable to start its daemon on my system recently with the following message:
----------------------------------------------------------------
[ERROR   ][deluge.core.daemon_entry      :1672] Unable to start deluged: [('SSL routines', '', 'ee key too small')]
----------------------------------------------------------------

Note: same error while invoking directly `deluged`.

I think this is related to the recent update of OpenSSL, from version 3.0.15 to 3.3.2.

I tried to recompiled both in this order dev-python/pyopenssl-24.2.1 and net-p2p/deluge-2.1.1-r5, no compilation issues neither improvement.

Here the package settings (full emerge --info <packages> as attachment):

dev-libs/openssl-3.3.2::gentoo was built with the following:
USE="asm quic -fips -ktls -rfc3779 -sctp -static-libs -test -tls-compression -vanilla -verify-sig -weak-ssl-ciphers" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="(sse2)"
CFLAGS="-march=znver2 -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack"
CXXFLAGS="-march=znver2 -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack"


dev-python/pyopenssl-24.2.1::gentoo was built with the following:
USE="-doc -test" ABI_X86="(64)" PYTHON_TARGETS="python3_12 (-pypy3) -python3_10 -python3_11 (-python3_13)"


net-p2p/deluge-2.1.1-r5::gentoo was built with the following:
USE="console gui libnotify -sound -test -webinterface" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 -python3_13"
Comment 1 Thibaud CANALE 2024-10-05 21:11:29 UTC
While running deluged with DEBUG output (`deluged --loglevel=debug`), here the output:
----------------------------------------------------------------
../..
23:07:48 [INFO    ][deluge.core.rpcserver         :1672] Starting DelugeRPC server localhost:58846
23:07:48 [DEBUG   ][deluge.core.rpcserver         :1672] Daemon already running or port not available.: [('SSL routines', '', 'ee key too small')]
23:07:48 [ERROR   ][deluge.core.daemon_entry      :1672] Unable to start deluged: [('SSL routines', '', 'ee key too small')]
23:07:48 [ERROR   ][deluge.core.daemon_entry      :1672] [('SSL routines', '', 'ee key too small')]
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/deluge/core/daemon_entry.py", line 109, in run_daemon
    daemon = Daemon(
             ^^^^^^^
  File "/usr/lib/python3.12/site-packages/deluge/core/daemon.py", line 127, in __init__
    self.rpcserver = RPCServer(
                     ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/deluge/core/rpcserver.py", line 420, in __init__
    port, self.factory, get_context_factory(cert, pkey), interface=hostname
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/deluge/crypto_utils.py", line 78, in get_context_factory
    ctx = cert_options.getContext()
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/twisted/internet/_sslverify.py", line 1633, in getContext
    self._context = self._makeContext()
                    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/twisted/internet/_sslverify.py", line 1642, in _makeContext
    ctx.use_certificate(self.certificate)
  File "/usr/lib/python3.12/site-packages/OpenSSL/SSL.py", line 1144, in use_certificate
    _raise_current_error()
  File "/usr/lib/python3.12/site-packages/OpenSSL/_util.py", line 57, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', '', 'ee key too small')]
23:07:48 [INFO    ][deluge.core.daemon_entry      :1672] Exiting...
----------------------------------------------------------------
Comment 2 Thibaud CANALE 2024-10-05 21:23:37 UTC
Okay, I personally fixed my issue by … deleting the self generated certificate and key in the "ssl" directory under its config directory (i.e "${XDG_CONFIG_HOME}/deluge/ssl").

Those were old files, using "OpenSSH private key" format, with "1204 bit, 2 primes".
The new key is using 2048 bit.