Trusted domains funktioniert nicht korrekt

Nextcloud.com 21.0.0
Operating system Xubuntu 21.04
Apache 2.4.41
PHP version 7.4

Ich nutze den DynDNS Account von AVM, sprich myfritz URL. In der Fritzbox habe ich auch eine Freigabe für den Port http und https eingerichtet.
in der config ist unter trusted domains die myfritz url eingetragen. Ich habe sowohl nur die myfritz url (myfritzurl.myfritz.net), als auch die myfritz url mit vorangestelltem hostname (hostname.myfritzurl.myfritz.net) versucht. Wenn ich nun die URL eingebe erhalte ich immer den Hinweis das dies keine Vertrauenswürdige Domain sei.
Wenn ich die IP dazu eintrage, wird die Seite sofort aufgerufen. Gebe ich nur die myfritzurl.myfritz.net ein lande ich auf dem Apache, das heißt also, dass die Weiterleituing der Fritzbox funktioniert, eben nur die Domain in NC nicht als vertrauenswürdig angesehen wird.
Weiß da jemand einen Rat?

Hallo @Oliver_Osranek,

Könntest du vielleicht Screenshots aufnehmen und die hier posten? Ich bin mir nämlich nicht ganz sicher dich richtig verstanden zu haben. Screenshots würden daher sicher helfen.

MfG, szaimen

Nun der Screenshot url zeigt das Ergebnis wenn ich NC via myfritz aufrufe.
der Screenshot IP zeigt wenn ich NC aufrufe und die momentane IP (DynDNS) in trusted domains eingetragen habe.
url

IP

Und hier noch die config

config

Hier noch der Apache wenn ich nur die myfritz url nutze ohne “/nextcloud”

Thanks! much clearer now.
It seems to me like there are some misconfigurations, hence it would be also helpful to get a few more infos about your systm including Apache conf, how you installed Nextcloud, etc.
You can use the issuetemplate app for this: Issue Template - Apps - App Store - Nextcloud
(But apache conf will not be included. that needs to be posted manually.)

I used the web installer and I will set the Apache config later

Sorry, but which apache2 config file do you mean? apache.conf or the config of sites-available aso.?

Well, I tried the following:
I installed UbuntuServer 20.04 and installed nextcloud as a snap.
Nexcloud runs great, but again the same problem.
If I enter the IP address in the trusted domains, I reach Nextcloud.
If I enter the url in the trusted domains, I get the error message that the domain is not trusted.

So if your assumption is correct, that there is a misconfiguration, there is none from my side.

I’ve just tried it out myself:
you need to add your domain to trusted_domains without subsequent slash.
Otherwise the domain will not be trusted.

1 Like

So I have tried every variant out of desperation:
domain only
domain with slash
domain without slash
Domain with “:Port”
domain without “:Port”
and all other combinations.
None leads to success.
Only if I enter the IP of the DynDNS it works.
And as already said, the same picture with the snap installation under Ubuntu Server 20.04

So, I have found the bug now.
If I enter the DynDNS url in the array at the position “0”, so at the first position it works.
As soon as the domain is in another position than the first one, it is not recognized as trustworthy anymore. This has no influence on IP addresses.

Interestingly, I can not connect the Android app via DynDNS. Here I always get the message that the host can not be found.

Great that you’ve fogured it out!

The android error sounds like:

thx a lot for your help and the last link.
I installed an older apk of nextcloud app and now I can use it.

1 Like

Hi Oliver,

I have exact the same problem but by placing the DynDNS URL from my fritz: raspberrypi.4m…myfritz.net to position “0” I cannot solve the problem.
What and how did you forward the ports in the fritzbox. Which url did you use and entered in the config? By trying to enter my DynDNS to Letsencrypt I get an error message saying: “Non-ASCII domain names not supported. To issue for an Internationalized Domain Name, use Punycode.”
I would be very happy to receive an answer from you or someone else. (A german answer is also okay)

Kind regards

Toasty

Hi Toasty,
sorry for my late reply.
So, I was actually able to replicate this on my end. If I did not set the URL of the Fritz Dyndns in the array to position “0”, then I could not log in to the server.
However, this only applies to logging in via browser. As soon as one with a current App version under Android & ChromeOS (is Android too) as well as under Windows does not work. It seems that it is not possible to log in with a self-signed certificate.
The only remedy under Android is to use an old version of the app with all the disadvantages that this version then brings with it.
As far as lets encrypt is concerned, this is because there is already a certificate for your Fritz URL. This is stored on the FB, so that you can log in there via browser from outside without receiving an error message.

Forwarding in the Fritzbox:
I made this as “Fritz share” as you can see on the following screenshot.


Hallo Toasty,
entschuldige meine verspätete Antwort.
Also, ich konnte das bei mir tatsächlich replizieren. Wenn ich die die URL der Fritz Dyndns im array nicht auf Position “0” setzte, dann konnte ich mich nicht am Server anmelden.
Das gilt allerdings ausschließlich für die Anmeldung via Browser. Sobald man mit einer aktuellen App Version unter Android & ChromeOS (ist Android) sowie unter Windows funktioniert nicht. Hier scheint es nicht möglich zu sein sich mit einem selbst signierten Zertifikat an zu melden.
Abhilfe unter Android schafft da nur eine alte Version der App zu nutzen mit all den Nachteilen die diese Version dann eben mit sich bringt.
Was das Thema lets encrypt betrifft, so liegt das daran, dass es für deine Fritz URL schon ein Zertifikat gibt. das ist ja auf der FB hinterlegt, so dass du dich dort via Browser von außen anmelden kannst ohne Fehlermeldung zu erhalten.

Weiterleitung in der Fritzbox:
Diese habe ich als “Fritz-Freigabe” gemacht wie du auf dem folgenden Screenshot sehen kannst.

Hallo Oliver,
vielen Dank für die Antwort. Ich habe in der Fritzbox nur den Port 443 und 80 freigegeben. Bei dir sehe ich, dass auch Port 22 freigeschaltet wurde. Liegt es unter Umständen daran, dass ich diesen Port nicht freigeschaltet habe? Ich sehe auf einem deiner Screenshots, dass deine myfritz url wesentlich länger ist. Ich habe in der config raspberrypi.4mz…myfritz.net angegeben. Ist das korrekt?

Meine Config sieht folgendermaßen aus:
image

Gruß
Toasty

Aaalso,
Port 22 ist für das Protokoll “ssh” (Fernzugriff via Shell), die Freigabe benötigst du nur wenn du auch via ssh auf den Raspi zugreifen willst. Das hat nix mit dem Zugriff auf die NC zu tun.
Meine URL ist wohl länger, weil mein Servefname länger ist. Außerdem werden die DynDNS url, soweit ich weiß, per Zufallsgeneration vergeben. Somit fallen die auch unterschiedlich lang aus.
Wenn du uf NC zugreifen willst, was erhälst du denn dann für eine Fehlermeldung?
Außerdem ist es wichtig dass du eine Fritzfreigabe machst. Wenn du die Ports “manuell” frei gibst, dann musst du die Ports für den Zugriff auf die Frítzbox Weboberfläche ändern, sonst wirst du immer wieder auf diese umgeleitet.