[SOLVED] Problem mounting directory with davs:// under Ubuntu (dav:// is working)

Hello,

this is my first post, so I hope to be in the right section. I am running the latest Nextcloud 20 appliance from https://www.hanssonit.se/nextcloud-vm/ on a proxmox host. I am running it exclusively in a LAN so I am using a self-signed SSL certificate (let’s encrypt needs a FQDN).

I have no problem to access my Nextcloud via Firefox or the Android application but I can’t get Nautilus to mount the directory under Ubuntu 18.04. I see the GNOME “online accounts” connects successfully (after accepting to ignore the self-signed certificate warning) but trying to mount the online directory always lead to the errors “HTTP Error: Unacceptable TLS certificate” or “HTTP Error: Found” via the GUI.

I read the documentation at https://docs.nextcloud.com/server/stable/user_manual/files/access_webdav.html and tried to mount manually to better understand what is happening but I get the same problem:

gio mount davs://<ip>/nextcloud/remote.php/dav/files/<username>/

returns the error:

HTTP Error: Unacceptable TLS certificate

and

mount -t davfs https://<ip>/nextcloud/remote.php/dav/files/<username>/ <mount_point>

returns the error:

/sbin/mount.davfs: Mounting failed.
302 Found

While it works perfectly if I just strip the “s” from the commands (like gio mount dav://<ip>/nextcloud/remote.php/dav/files/<username>/ or mount -t davfs http://<ip>/nextcloud/remote.php/dav/files/<username>/ <mount_point>)

Do you know how to mount the directory with SSL? I guess this is more a GNOME / Ubuntu problem but I thought many people would have the same problem here. I know there is a linux client for Nextcloud but I would like the use a pure webdav solution

Thanks for any help!

I do mount it via UI and have no error seen, but I have valid signed Certificate from Let’s Encrypt for my domain (not direct IP address connection).

Make sure that your self signed certificate of the remote server can be verified correctly on that server and make sure that it contains the used ip address. I personally prefer to use FQDN which require a working local DNS server.

Hello,

about accepting the self-signed certificate:

  • using the “add Nextcloud online account” which creates a “davs://” bookmark in Nautilus, I can just ignore the self-signed certificate warning message

  • using the “davfs” mount, I can just copy the Apache certificate of the Nexcloud server (/etc/ssl/certs/ssl-cert-snakeoil.pem in my case) on the client and link it with the “trust_server_cert” option in /etc/davfs2/davfs2.conf

But I discovered the source of the problem. The path is different if I access it with or without encryption.

  • without encryption, the path is <protocol>://<ip>/nextcloud/remote.php/dav/files/<username>

  • without encryption, the path is <protocol>://<ip>/remote.php/dav/files/<username>

As you can see, the subdirectory “nextcloud” is skipped if using davs or https, which is in contradiction with the documentation at https://docs.nextcloud.com/server/20/user_manual/en/files/access_webdav.html

I thought it could be a specificity from the appliance I downloaded from https://www.hanssonit.se/nextcloud-vm but I see both /etc/apache2/sites-available/nextcloud_http_domain_self_signed.conf and /etc/apache2/sites-available/nextcloud_tls_domain_self_signed.conf have the same DocumentRoot /var/www/nextcloud option… Also, I just realized the “add Nextcloud online account” approach on Ubuntu 20.04 now automatically creates the correct bookmark path, pointing to davs://<user>@<ip>/remote.php/webdav

So the documentation might be incorrect after all.

2 Likes