From 89547c395fc814cd896401889333d88db14e8f00 Mon Sep 17 00:00:00 2001 From: jknapp Date: Sat, 28 Nov 2026 11:03:30 -0800 Subject: [PATCH] mariadb client: ssl-verify-server-cert=0 drop-in (cac, cac-fpm) An 11.x client fails against a 10.11 server ("ERROR 2026: SSL is required, but the server does not support it") and against 11.x with a passwordless account ("self-signed certificate"). Ship /etc/my.cnf.d/zz-whp-client.cnf with [client] ssl-verify-server-cert=0 so the client series does not matter; TLS is still negotiated where the server offers it. Measured: mariadb:11.8 client with the drop-in vs 10.11.18 and 11.8 servers, 10.11 client vs both. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6 --- Dockerfile | 2 ++ Dockerfile.fpm | 2 ++ configs/whp-mariadb-client.cnf | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 configs/whp-mariadb-client.cnf diff --git a/Dockerfile b/Dockerfile index 990687d..2c43caa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -80,6 +80,8 @@ COPY ./configs/prod-php.ini /etc/php.ini COPY ./configs/zz-php2shell-mitigation.ini /etc/php.d/zz-php2shell-mitigation.ini COPY ./configs/phpinfo.php /var/www/html/ COPY ./configs/mariadb.repo /etc/yum.repos.d/ +# MariaDB client defaults: connect to the WHP mysql container whatever the client/server series. +COPY ./configs/whp-mariadb-client.cnf /etc/my.cnf.d/zz-whp-client.cnf # mirror.mariadb.org names the arch dir amd64/aarch64 (not $basearch); amd64 result is byte-identical. RUN sed -i "s/rhel\$releasever-amd64/rhel\$releasever-$(uname -m | sed s/x86_64/amd64/)/" /etc/yum.repos.d/mariadb.repo COPY ./configs/index.php /var/www/html/ diff --git a/Dockerfile.fpm b/Dockerfile.fpm index 2b6a90b..5c0a721 100644 --- a/Dockerfile.fpm +++ b/Dockerfile.fpm @@ -77,6 +77,8 @@ COPY ./configs/prod-php.ini /etc/php.ini # all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12. COPY ./configs/zz-php2shell-mitigation.ini /etc/php.d/zz-php2shell-mitigation.ini COPY ./configs/mariadb.repo /etc/yum.repos.d/ +# MariaDB client defaults: connect to the WHP mysql container whatever the client/server series. +COPY ./configs/whp-mariadb-client.cnf /etc/my.cnf.d/zz-whp-client.cnf # mirror.mariadb.org names the arch dir amd64/aarch64 (not $basearch); amd64 result is byte-identical. RUN sed -i "s/rhel\$releasever-amd64/rhel\$releasever-$(uname -m | sed s/x86_64/amd64/)/" /etc/yum.repos.d/mariadb.repo diff --git a/configs/whp-mariadb-client.cnf b/configs/whp-mariadb-client.cnf new file mode 100644 index 0000000..704467a --- /dev/null +++ b/configs/whp-mariadb-client.cnf @@ -0,0 +1,19 @@ +# Client defaults for the mariadb/mysql/mariadb-dump CLIs in this image. +# +# The MariaDB server runs in WHP's separate `mysql` container, reached over +# the docker bridge. An 11.x client defaults to "TLS required, verify the +# certificate": against a 10.11 server it fails with +# ERROR 2026: SSL is required, but the server does not support it +# and against an 11.x server with a passwordless account with "self-signed +# certificate". This image ships a 10.11 client today (no effect), but WP-CLI +# `wp db ...`, mysqldump and any client a customer adds would break the day the +# client series differs from the server's. +# +# ssl-verify-server-cert=0 (measured on mariadb:11.8 and 10.11.18 clients vs +# 10.11.18 and 11.8 servers) keeps TLS negotiated when the server offers it and +# stops the verification/"required" failure, so a customer who points the CLI at +# a remote TLS database is not downgraded to plaintext. A customer who wants +# verification passes --ssl-verify-server-cert or sets it in ~/.my.cnf (later +# files and the command line win). +[client] +ssl-verify-server-cert=0