We're Hiring!

Mattermost, Inc.

X509: certificate is valid for localhost

Hi All,

I have a problem with accessing mattermost endpoints with https. After changing the configuration to use FQDN instead of localhost, I get this (for example):
"AuthorizeOAuthUser: Token request failed., Post “https://oshani-tests.cs.huji.ac.il:8443/auth/realms/mattmost/protocol/openid-connect/token”: x509: certificate is valid for localhost, not "

So I would like to know how can I regenerate a certificate for the FQDN (I did not generate any certificate, so I guess one was automaitcally generated when I brought up Mattermost for the first time)

Many thanks,

Hello, @orenshani7

In this case, may I know if you have checked on the following guide on how you can set up SSL with Mattermost?

You can consider setting up SSL on Mattermost Server or set up TLS with proxy, depending on your requirement.

Hi Ahmad,

The problem turned out to be with the other side of the service (Keycloack).

Thank you anyway,


1 Like