Skip to content

fix(minimal): use TLS flags the installed mysql client understands (arm64 / MariaDB client) - #180

Merged
jsokol merged 1 commit into
testingfrom
FIX-mariadb-client-ssl-flags
Oct 28, 2026
Merged

jsokol merged 1 commit into
testingfrom
FIX-mariadb-client-ssl-flags

Conversation

@jsokol

@jsokol jsokol commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Problem

On the arm64 image mysql is MariaDB's client: Debian's default-mysql-client is installed there because MySQL's apt repo has no arm64 packages (see the Dockerfile comment; re-checked 2026-10-28: repo.mysql.com/apt/debian/dists/{trixie,bookworm}/mysql-8.4-lts/binary-arm64 returns 404). MariaDB's client has no --ssl-mode. With DB_SSL_ENABLED=true (CDK-managed RDS, IAM auth token) the privileged setup and delete calls fail:

mysql: unknown variable 'ssl-mode=REQUIRED'
[error] Was not able to apply settings on database.

so no customer database can be created on Graviton. Found on the first Canada deploy (simplerisk-minimal:20261020-001-php85, Debian 13, mariadb-client 11.8.6, aarch64). amd64 is unaffected because it installs Oracle's mysql-community-client.

Change

set_db_ssl_flags asks the client what it supports (mysql_client_supports_ssl_mode: does mysql --help list --ssl-mode):

  • Oracle client: unchanged, --ssl-mode=REQUIRED --enable-cleartext-plugin.
  • MariaDB client: --ssl --skip-ssl-verify-server-cert. TLS is required and the server certificate is not verified, the same as REQUIRED; the cleartext plugin is built in (--enable-cleartext-plugin is obsolete there and only warns).
  • Client cannot be asked: keep the historical flags.
    Opt-in rule is unchanged: only exactly DB_SSL_ENABLED=true adds flags. README row updated.

This is separate from commit 3a8f83e (apply_mail_setting no longer forces --ssl-mode=DISABLED), which is already on testing and not the cause of this failure.

Verification

  • test_db_ssl_flags.sh (new, runs in CI): fake clients with --help shaped like the real ones; covers both clients, the opt-in-only rule (unset/false/TRUE/1/empty) and the fallback. Fails on testing, passes here. test_escaping.sh still passes.
  • On a real arm64 node against the Canada RDS (MySQL 8.4.8, IAM auth token): with the GA image's own mysql, the functions lifted from this entrypoint (set_db_ssl_flags + mysql_setup) connect over TLS (TLS_AES_256_GCM_SHA384) as the master user, exit 0. The old flags fail on the same node with the error above.
  • Not run: a full image build or a full DB_SETUP=automatic run; the CI image build covers the Dockerfile, which is unchanged.

Follow-up (not in this PR)

The arm64 image has never been exercised natively against a TLS-only RDS before; consider an arm64 smoke test in CI.

🤖 Generated with Claude Code

The arm64 image's mysql is MariaDB's client (Debian's default-mysql-client; MySQL's apt repo has
no arm64 packages), which rejects --ssl-mode. With DB_SSL_ENABLED=true the privileged setup and
delete calls failed with "unknown variable 'ssl-mode=REQUIRED'", so no customer database could
be created on Graviton against a TLS-only RDS (found on the first Canada deploy).

set_db_ssl_flags now asks the client: Oracle's keeps --ssl-mode=REQUIRED --enable-cleartext-plugin
(unchanged for amd64); MariaDB's gets --ssl --skip-ssl-verify-server-cert, its equivalent (TLS
required, certificate not verified, cleartext plugin built in). If the client cannot be asked the
historical flags are kept.

Verified on an arm64 node against the Canada RDS (MySQL 8.4.8, IAM auth token): the lifted
set_db_ssl_flags + mysql_setup connect over TLS as the master user. test_db_ssl_flags.sh covers
both clients, the opt-in-only rule and the fallback, and fails on the old code; it runs in CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jsokol
jsokol merged commit 31b9de9 into testing Oct 28, 2026
8 checks passed
@jsokol
jsokol deleted the FIX-mariadb-client-ssl-flags branch October 28, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant