TLS client certificate authentication
Authenticate MariaDB Enterprise Operator to MariaDB with TLS client certificates instead of passwords, as required for strict FIPS 140-3 mode.
The operator can authenticate to MariaDB using a TLS client certificate instead of a password. When this mode is enabled, the operator (and the components it manages) present the mounted client certificate to the server, and the server authorizes the connection based on the certificate's X.509 subject and issuer (REQUIRE SUBJECT / REQUIRE ISSUER) rather than a shared secret.
This is primarily intended for strict FIPS 140-3 compliance (GODEBUG=fips140=only), where password-based authentication plugins rely on cryptographic primitives (e.g. SHA-1) that are prohibited under strict enforcement. See the TLS guide for how the operator provisions and mounts certificates.
Please refer to the MariaDB documentation for more details about requiring TLS for user accounts.
Overview
When spec.tls.clientAuth.enabled is set to true:
The operator no longer manages a root password:
spec.rootPasswordSecretKeyRefmust not be set, and no root passwordSecretis generated.The
rootuser is bootstrapped with a certificate requirement (REQUIRE SUBJECT '...' ISSUER '...') and an empty password.The operator connects to MariaDB using its certificates, instead of passwords. Passwords are read on demand from secrets.
Internal users managed by the operator (replication, metrics, MaxScale) are provisioned to require an X.509 client certificate as well.
It is disabled by default, so existing MariaDB resources are unaffected.
Additionally, once a MariaDB CR is created, the value of spec.tls.clientAuth.enabled cannot be changed. To move an existing password-based MariaDB to this mode, see the migration guide.
Prerequisites
TLS must be enabled (
spec.tls.enabled: true). Client certificate authentication builds on the operator's PKI, which issues both the server and client certificates. The webhook rejectsclientAuthwhen TLS is disabled, and sinceclientAuthis immutable, TLS cannot be disabled afterwards.A root password must not be configured. Setting both
spec.tls.clientAuth.enabledandspec.rootPasswordSecretKeyRefis rejected by the validating webhook.
Enabling client certificate authentication
Because the operator authenticates with a certificate, do not provide rootPasswordSecretKeyRef:
A complete example provisioning a replication cluster with client certificate authentication is available in mariadb_replication_client_tls.yaml in the examples catalog.
TLS requirements
spec.tls.clientAuth exposes two TLSRequirements overrides:
rootTLSRequirements: the requirement therootuser is required to present. By default, it is derived from the operator-issued client PKI:REQUIRE SUBJECT '/CN=<mariadb-name>-client' ISSUER '/CN=<mariadb-name>-ca'.tlsRequirements: the requirement every other operator-managed user (replication, metrics, MaxScale's internal users, ...) is required to present. It defaults to the effectiverootrequirement, so overriding onlyrootTLSRequirementsapplies to every operator-managed user.
Both accept the same shape as a User's spec.require (subject, issuer). The operator-managed users are passwordless, so subject is mandatory: ssl-only (any TLS connection) and x509-only (any certificate issued by the trusted client CAs) requirements are rejected, as they would not bind the account to a certificate identity.
For a MariaDB named mariadb, the defaults result in REQUIRE SUBJECT '/CN=mariadb-client' ISSUER '/CN=mariadb-ca' for root and for the other users.
There is no per-component override (for example, for the replication user): tlsRequirements is the single setting for every operator-managed user other than root, so the certificate presented by the replicas must match it.
Bring your own certificates
When you provide your own client certificate (spec.tls.clientCertSecretRef), your own CA (spec.tls.clientCASecretRef) or a cert-manager issuer (spec.tls.clientCertIssuerRef) whose distinguished names do not follow the default convention, override the expected requirements explicitly. Subject/Issuer must be expressed in OpenSSL one-line format:
Behavior across components
Client certificate authentication is propagated to every operator-managed component that connects to the database:
Replication: the replication user is created with
spec.tls.clientAuth.tlsRequirements(therootrequirement by default), and replicas connect to the primary over TLS (CHANGE MASTER ... MASTER_SSL=1) using the client certificate instead of a replication password.spec.replication.replica.replPasswordSecretKeyRefis not required.Backups and restores: logical backups, physical backups (PVC, S3, Azure and
VolumeSnapshot), point-in-time recovery andbootstrapFromall authenticate with the client certificate. No password environment variable is injected into the backup/restoreJobs.Metrics: the metrics exporter user is created with
spec.tls.clientAuth.tlsRequirements(therootrequirement by default) and the exporter connects using the client certificate; no metrics passwordSecretis generated.MaxScale: the internal MaxScale users (
client,server,monitor, and the config sync user) are created with a certificate requirement, and MaxScale presents the client certificate to the backend.
MaxScale
When a MaxScale references a MariaDB that uses client certificate authentication, MaxScale TLS must be enabled (spec.tls.enabled: true). The operator will refuse to reconcile the MaxScale otherwise, since MaxScale needs to present a client certificate to connect to the backend.
spec.tls.verifyPeerCertificate defaults to true for the connection to the MariaDB servers when it is not set, so MaxScale validates the MariaDB server certificates. Set it explicitly to override. On the MaxScale listeners it only applies when set explicitly, and then requires every client connecting through MaxScale to present a certificate.
When the MariaDB uses replication, spec.tls.replicationSSLEnabled defaults to true and must not be set to false: MaxScale re-points the replicas after a failover using the client certificate, and the operator refuses to reconcile the MaxScale otherwise.
Galera
When a MariaDB uses Galera together with client certificate authentication:
spec.tls.galeraSSTEnabledmust be set totrueexplicitly, as it defaults tofalse. This makes the SST stream encrypted and present the client certificate. The validating webhook rejects theMariaDBotherwise.The SST authenticates as
rootwithout a password (wsrep_sst_auth="root:").The
mysqldumpSST (spec.galera.sst: mysqldump) is not supported, as it authenticates with a password. Usemariabackup, which is the default.
A complete example is available as mariadb_galera_client_tls.yaml in the examples catalog.
Per-User client certificates
Independently of spec.tls.clientAuth (which governs how the operator itself connects), a User resource can have the operator issue it a dedicated TLS client certificate via spec.clientCertificate.enabled:
The certificate is signed by the same CA the referenced
MariaDBuses for its own client certificate (operator-managed CA, bring-your-own CA, or cert-manager viaspec.tls.clientCertIssuerRef), and stored in aSecretnamed<user-name>-client-certin theUser's namespace.It requires the referenced
MariaDBto havespec.tls.enabled: true;spec.tls.clientAuthdoes not need to be enabled.The
Usermay live in a different namespace than theMariaDBit references (viaspec.mariaDbRef.namespace). When the referencedMariaDBuses a cert-managerIssuer(notClusterIssuer) for its client certificate, cross-namespace issuance is not possible — cert-managerIssuers are namespace-scoped, so theMariaDBandUsermust share a namespace in that case, or aClusterIssuermust be used.Issuing the certificate does not by itself enforce certificate authentication for the
User— setspec.requireto require it (see TLS requirements for the convention the operator's own certificates follow).
FIPS 140-3
Under strict FIPS enforcement (GODEBUG=fips140=only), password-based authentication plugins cannot be used because the initial MariaDB protocol handshake eagerly evaluates SHA-1, which is prohibited. Client certificate authentication sidesteps password hashing entirely, making it the recommended authentication mode for strict FIPS deployments. See FIPS 140-3 mode for how to enable strict mode.
Limitations
Immutable:
spec.tls.clientAuthcannot be changed after theMariaDBis created. To enable client certificate authentication on an existing password-basedMariaDB, migrate its data to a new instance following the migration guide.ExternalMariaDB: client certificate authentication is not supported forExternalMariaDBresources.Multi-cluster: client certificate authentication is not supported with multi-cluster, as cross-cluster replication authenticates against the remote
ExternalMariaDBwith a password.MaxScale version: client certificate authentication requires MaxScale 25.10.4 or later, as noted above. Older versions are not supported.
Galera SST:
spec.tls.galeraSSTEnabledmust be set totrueand themysqldumpSST is not supported, as described above.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

