deluge-console 'ssl handshake failure'

General support for problems installing or using Deluge
Post Reply
pjlbyrne
Leecher
Leecher
Posts: 59
Joined: Thu May 22, 2014 9:28 am

deluge-console 'ssl handshake failure'

Post by pjlbyrne »

Hi,

I just rebuilt deluge development branch on my debian box (server) and windows pc (thin client).

I can connect ok from the windows pc.

I can no longer connect with deluge-console on the server. The daemon.log shows:
13:38:11.500 [INFO ][deluge.core.rpcserver:171 ] Deluge client disconnected: [('SSL routines', 'SSL3_READ_BYTES', 'ssl handshake failure')]

I found this issue:
http://dev.deluge-torrent.org/ticket/2555#no1

and applied this patch:
diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py
index 649c2ce..65601df 100644
--- a/deluge/core/rpcserver.py
+++ b/deluge/core/rpcserver.py
@@ -131,7 +131,8 @@ def getContext(self):
SSL transport.
"""
ssl_dir = deluge.configmanager.get_config_dir("ssl")
- ctx = SSL.Context(SSL.SSLv3_METHOD)
+ ctx = SSL.Context(SSL.SSLv23_METHOD)
+ ctx.set_options(SSL.OP_NO_SSLv2 & SSL.OP_NO_SSLv3)
ctx.use_certificate_file(os.path.join(ssl_dir, "daemon.cert"))
ctx.use_privatekey_file(os.path.join(ssl_dir, "daemon.pkey"))
return ctx

( and rebuilt, re-installed and restarted the deluge daemon, obviously)

... but the problem persists.

Can someone please advise how I might resolve this issue? Thanks.

-- Patrick
pjlbyrne
Leecher
Leecher
Posts: 59
Joined: Thu May 22, 2014 9:28 am

Re: deluge-console 'ssl handshake failure'

Post by pjlbyrne »

I applied the patch here:
http://git.deluge-torrent.org/deluge/commit/?h=develop

which is:
diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py
index 8ec1acc..f99daa1 100644
--- a/deluge/ui/web/server.py
+++ b/deluge/ui/web/server.py
@@ -542,7 +542,7 @@ class ServerContextFactory:

def getContext(self): # NOQA
"""Creates an SSL context."""
- ctx = SSL.Context(SSL.SSLv3_METHOD)
+ ctx = SSL.Context(SSL.TLSv1_METHOD)
deluge_web = component.get("DelugeWeb")
log.debug("Enabling SSL using:")
log.debug("Pkey: %s", deluge_web.pkey)

.... and now it is working
pjlbyrne
Leecher
Leecher
Posts: 59
Joined: Thu May 22, 2014 9:28 am

Re: deluge-console 'ssl handshake failure'

Post by pjlbyrne »

PS the gtk interface looks a lot nicer since I last built it in April. Roll on deluge 1.4 release.....
Post Reply