erickok / transdroid

Manage your torrents from your Android device
GNU General Public License v3.0
1.28k stars 201 forks source link

rTorrent connection refused #394

Closed dmemedo closed 6 years ago

dmemedo commented 6 years ago

Hello,

I love your app, but I'm having problems connecting now that I'm trying to move to rtorrent

Transdroid 2.5.8 (228)
rTorrent settings: https://seedbox@seedbox:443/RPC2

Connection and error log:
1045 -- Sun Oct 22 20:43:06 GMT+02:00 2017 -- 3 -- Calling system.client_version with params [ ]
1046 -- Sun Oct 22 20:43:13 GMT+02:00 2017 -- 3 -- de.timroes.axmlrpc.XMLRPCException: org.apache.http.conn.HttpHostConnectException: Connection to https://seedbox:443 refused
1047 -- Sun Oct 22 20:43:13 GMT+02:00 2017 -- 3 -- Calling d.multicall2 with params [  main d.hash= d.name= d.state= d.down.rate= d.up.rate= d.peers_connected= d.peers_not_connected= d.... ]
1048 -- Sun Oct 22 20:43:19 GMT+02:00 2017 -- 3 -- de.timroes.axmlrpc.XMLRPCException: org.apache.http.conn.HttpHostConnectException: Connection to https://seedbox:443 refused
1049 -- Sun Oct 22 20:43:19 GMT+02:00 2017 -- 3 -- ConnectionError exception: Error making call to d.multicall2 with params [  main d.hash= d.name= d.state= d.down.rate= d.up.rate= d.peers_connected= d.peers_not_connected= d.... ]: de.timroes.axmlrpc.XMLRPCException: org.apache.http.conn.HttpHostConnectException: Connection to https://seedbox:443 refused
1050 -- Sun Oct 22 20:43:45 GMT+02:00 2017 -- 3 -- Calling system.client_version with params [ ]
1051 -- Sun Oct 22 20:43:52 GMT+02:00 2017 -- 3 -- de.timroes.axmlrpc.XMLRPCException: org.apache.http.conn.HttpHostConnectException: Connection to https://seedbox:443 refused
1052 -- Sun Oct 22 20:43:52 GMT+02:00 2017 -- 3 -- Calling d.multicall2 with params [  main d.hash= d.name= d.state= d.down.rate= d.up.rate= d.peers_connected= d.peers_not_connected= d.... ]

I'm using nginx as a front :

       location /RPC2 {
                scgi_pass   127.0.0.1:5000;
                include     scgi_params;
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/.htpasswd;
                include /etc/nginx/conf.d/php;
                include /etc/nginx/conf.d/cache;
        }

I don't even see the connection request in access logs.

But I'm using the exact same configuration for sonarr and it's working and I see :

192.168.138.3 - seedbox [22/Oct/2017:20:53:26 +0200] "POST /RPC2 HTTP/1.1" 200 152 "-" "XML-RPC.NET"
192.168.138.3 - - [22/Oct/2017:20:53:26 +0200] "POST /RPC2 HTTP/1.1" 401 188 "-" "XML-RPC.NET"
erickok commented 6 years ago

I don't see anything totally obvious but are you sure you have SSL properly configured?

erickok commented 6 years ago

Requesting https://seedbox@seedbox:443/RPC2 from a browser should work (with a blank page as result).

dmemedo commented 6 years ago

I get a 502 when using the browser to access https://seedbox@seedbox:443/RPC2, which I think is normal as written on https://github.com/rakshasa/rtorrent/wiki/RPC-Setup-XMLRPC

And I don't know how it could be SSL related as it's working to access /rutorrent and /RPC2 is working for sonarr.

How can I provide more info ? Is there a way to debug more ?

erickok commented 6 years ago

Hmm looks in your log that you send a 401 and indeed Transdroid logs connection refused so my guess is a username password issue.

erickok commented 6 years ago

Also is this a local server? Try the IP instead of hostname.

dmemedo commented 6 years ago

It's indeed a local server, I already tried using the IP. I also tried to remove username/password requirement and still had the error, the weird thing is that I don't see anything in the access log coming from transdroid

erickok commented 6 years ago

It's hard to tell without any access to your server. When you removed the username/password, did you check the 'Disable authentication' setting? Also can you try the URL from your Android browser?

dmemedo commented 6 years ago

yes I did check that option.

I'm getting the same page (502 when using phone)

But here's something weird, I tried to access it using Firefox Focus browser and I'm getting "Secure connection failed", can it be related to the self signed SSL certificate ?

dmemedo commented 6 years ago

I can confirm my theory. I disabled https redirection, configured transdroid to disable SSL and that worked!

any chance to fix that ?

erickok commented 6 years ago

Yes you get either a real certificate (I can recommend Let's Encrypt) or enter the SHA-1 of your SSL certificate in Transdroid under Advanced Settings. Technically you can also ignore all SSL issues by using 'Accept all' in Transdroid, but I can't recommend this really because it makers your connection insecure again. Use it only for for testing or local network connections perhaps.

simonc56 commented 6 years ago

Hi, I have the same bug with transdroid 2.5.10. My server uses a Let's Encrypt certificate. I can connect with a web browser (on android 7 and on pc) and with Transdroid on Android 6, but not with Transdroid on Android 7.0.

Your last recommandations do nothing.

I tested the server on ssllabs : all is good.

Thank you for your help.