matomo-org / matomo-org/docker

[Bug] PHP 8.2 and 8.3 breaks the SSL connection to Matomo's database

Open
#363 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
1k
Forks
384
PR merge metrics
No merged PRs in 30d

Description

**What happened?**
- The config file and certificate work fine for PHP 8.1.
- But as soon as PHP 8.2 or 8.3 are implemented the following error is thrown

[PDOException]
PDO::__construct(): Unable to set local cert chain file `/run/secrets/mysql
/tls.crt'; Check that your cafile/capath settings include details of your certificate and its issuer
See more below.

**What should happen?**
SSL cert should be found when connecting to db with PHP 8.2.

**How can this be reproduced?**
To reproduce the problem:

Update to either PHP to 8.2 or 8.3*
Matomo will fail to connect to the database; it breaks Matomo**
Roll back to PHP 8.1***
Matomo works normally
*PHP 8.2-fpm-alpine or PHP 8.3.8-fpm-alpine
**The error is [PDOException]
PDO::__construct(): Unable to set local cert chain file `/run/secrets/mysql /tls.crt'; Check that your cafile/capath settings include details of your certificate and its issuer
But the config file is fine when using PHP 8.1.
***Php 8.1.15-fpm-alpine

**Matomo version**
5.1.0

Server operating system
https://github.com/matomo-org/docker/blob/master/fpm-alpine/Dockerfile

Computer operating system
Alpine Linux

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fpm-alpine/Dockerfile and compare the PHP 8.1.15-fpm-alpine image with the reported PHP 8.2 and 8.3-fpm-alpine versions. Reproduce the PDOException using the stated certificate configuration and inspect how the image and PHP version handle the local certificate chain. Done means Matomo connects to its database over SSL without the certificate error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, php
Domain
databases, infrastructure, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.