DAVdroid can only connect to and synchronise with my (nextCloud) server from the local network; from external IPs I cannot connect.

  • Hi,

    I incidentally came across the solution to my problem by myself, but I will still post this thread as I don’t really understand what’s going on and already put alot of effort into collecting all neccessary logs. I beg your pardon.

    I run the recent version of nextCloud (11) on a RaspberryPI-powered archlinux-arm operation system. The webserver is nginx (1.11.9). Port-forwarding on my router is set from port 4433 to 443 of my server’s local IP and I append that port info to DAVdroid accordingly.

    I setup everything by the books and could install nextCloud just fine:

    • Access via the web interface is possible with a local IP aswell as an external one.
    • Import of my self-signed certificate via CAdroid worked perfectly well.
    • The nextCloud client for Android is syncing just fine from external IP.

    My problem was the following:

    • DAVdroid could only connect to my server with a local IP when in the same network. If I tried to connect (to the DNS name of my server) while having an external IP, it failed (calendar and contacts could not be found).

    Relevant log files can be found here: https://paste.xinu.at/m-H2fKw/

    Now, the solution:

    I wanted to test my server with SSLLABS and they can’t scan any other port than 443. So, I forwarded that port temporarily to my server in order to be able to test. In this state, I just gave connecting with the external IP another shot and - BAM - it works. Now, could someone tell me what is wrong here? It seems to me like the port-forwarding or redirecting of port 4433 to port 443 does not work. I have, however, port 222 forwarded to 22 for SSH which is working just fine. I would really love to see someone clear the air for me.

    Thanks a ton for your time and


  • Maybe a dev could try to connect using a test account? The “problem” still prevails and I’d love to get a really clean setup and not have to open two ports even though it should work with one just fine.

  • developer

    Sounds like a connectivity problem. What does “can’t connect” mean?

    DAVdroid doesn’t make a difference between IP addresses, internal/external etc. It uses the standard Android network stack to connect to hosts, so I can’t imagine how this could be a DAVdroid problem.

    If you send a test account to play@bitfire.at, I can try to connect.

  • Hi,

    I just sent you that mail with a working test account to the address provided.
    I am really greatful for your help.

    Thanks and BR

  • developer

    @blablubb1234 Have replied over email. Does it solve your problem?

  • Hi @rfc2822,

    thanks for your reply and the help with this issue. It is working now with only port 4433 forwarded.

    Here is the solution:

    As I am forwarding a non-standard port (4433) for SSL/TLS connections to my nextCloud server (which itself is listening on port 443 in my private network), I have to make sure that DAVdroid uses port 4433 aswell.

    Though DAVdroid was set up like this using the standard URI www.example.com:4433 it did not work because using the short version of the URI and not the one actually pointing to the WebDAV interface (for nextCloud: www.example.com/remote.php/dav) resulted in the well-known URIs kicking in. Unfortunately, I did not change them to forward to port 4433 but kept the standard version of my nginx config.

    So, the well-known URIs where forwarding to the standard port for SSLL/TLS. And that’s why it worked when I opened port 443 in addition to port 4433.

    Hope this will be of help for someone who also uses a non-standard port 🙂

    Thanks again and best regards.

Similar topics