TLS problem to connect to mysql db

Summary
Issue in one concise sentence

Steps to reproduce
Run mattermost container

Expected behavior
Mattermost can connect to the BDD using TLS

Observed behavior

Hello,

I try to set up mattermost 7.5.2 with mysql BDD 8. I use a connexion string like this one

mysql://*USERNAME*:*PASSWORD*@tcp(*DB*:3306)/mattermost?&charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s&tls=true

If I run the mattermost container there is the error I got :

Error: failed to load configuration: failed to initialize: driver: mysql, message: failed to grab connection to the database, command: grabbing_connection, originalError: x509: certificate signed by unknown authority, query:

I tried to use this connexion string (without tls)

mysql://*USERNAME*:*PASSWORD*@tcp(*DB*:3306)/mattermost?allowCleartextPasswords=true&charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s&tls=false

It worked like that but I do not want to keep this unsecure configuration.

Do you have an idea why I have this issue ?

Hi @Pierre67,

you can use tls=skip-verify to skip the CA check. You can find the valid options here.

1 Like

There are a few possible reasons for this error:

  1. The certificate used by the database server is not trusted by the client. This could be because the certificate is self-signed, or because the client does not have the root certificate of the certificate authority that signed the certificate.
  2. The certificate has expired or is otherwise invalid.
  3. There is a problem with the TLS configuration on the client or the server.