@schousda opened this Issue on December 21st 2018

Hello,

if i add a domain with german umlauts, like "ä", "ö" or "ü" to my matomo configuration, i can't access the login.
I have to add the punycode domain to my settings to make it work.

Warnung: Sie betreten Matomo aktuell von https://a.domäne.de/, allerdings wurde Matomo so konfiguriert, dass es unter dieser Adresse läuft: https://a.domain.de/.

Hier klicken um Matomo sicher zu betreten und die Warnung zu entfernen. Zusätzlich können Sie den Matomo Administrator kontaktieren und ihn auf dieses Problem hinweisen ().

How do I fix this problem and how do I login again?
The Matomo Super User can manually edit the file piwik/config/config.ini.php and add the following lines:

[General]
trusted_hosts[] = "domäne.de"

After making the change, you will be able to login again.

You may also disable this security feature (not recommended). To do so edit config/config.ini.php and add:

[General]
enable_trusted_host_check=0
@tsteur commented on December 23rd 2018 Member

Unfortunately my local server doesn't support umlauts in the domain so I cannot fully reproduce. I still debugged Matomo though and how we read the trusted hosts configuration and there everything should be all fine.

In case you can access your Matomo instance on the server, can you for a one time test change this line?
https://github.com/matomo-org/matomo/blob/3.8.0-b5/core/Url.php#L211
from $host = @$_SERVER['HTTP_HOST']; to $host = @$_SERVER['HTTP_HOST'];var_export($host);exit;?
And then reload the page... Make sure to undo the change afterwards. Could you send us the output of that?

@Findus23 commented on December 28th 2018 Member

That's interesting because for me it is working fine.
I added 127.0.0.15 äöü-test.matomo to /etc/hosts and curl couldn't connect:

$ curl http://äöü-test.matomo -v
* Could not resolve host: xn---test-fra0kzb.matomo
* Closing connection 0
curl: (6) Could not resolve host: xn---test-fra0kzb.matomo

So I know that xn---test-fra0kzb.matomo was the punycode and added it to /etc/hosts and DNS was working fine.
I also added the punycode (not the umlaut domain) to server_name in the nginx config.
Afterwards Matomo loaded correctly and suggested adding the punycode to the config.
grafik
(unrelated, but after 3.7.0. that screen looks a bit ugly)

After adding it Matomo works as it should.

@tsteur commented on December 30th 2018 Member

@schousda I'll close the issue for now as it seems to work, but feel free to comment and reopen if you still experience the issue and ideally give us the output of the HOST entry mentioned above.

This Issue was closed on December 30th 2018
Powered by GitHub Issue Mirror