[MDEV-27181] Galera SST scripts should use ssl_capath (not ssl_ca) for CA directory Created: 2021-12-07  Updated: 2023-05-16  Resolved: 2021-12-14

Status: Closed
Project: MariaDB Server
Component/s: Galera, Galera SST, wsrep
Affects Version/s: 10.2.41, 10.3.32, 10.4.22, 10.5.13, 10.6.5, 10.7.1
Fix Version/s: 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2

Type: Bug Priority: Critical
Reporter: Geoff Montee (Inactive) Assignee: Julius Goryavsky
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-28170 missing '$' in variable check in wsre... Closed
is caused by MDEV-26360 Using hostnames for MariaBackup SSTs ... Closed
Relates
relates to MDEV-23747 socket.ssl_ca argument being ignored. Closed

 Description   

Based on a discussion with sysprg, the SST script changes from MDEV-26360 allow users to configure a CA directory by setting ssl_ca, like this:

[mariadb]
...
wsrep_ssl_mode = SERVER_X509
 
ssl_ca = /certs/ca-cert/
ssl_cert = /certs/server-cert.pem
ssl_key = /certs/server-key.pem

This implementation is likely to result in problems. ssl_ca is a system variable owned by MariaDB Server. MariaDB Server expects the ssl_ca system variable to refer to an absolute path to a single PEM file:

ssl_ca
Description: Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for TLS. This system variable requires that you use the absolute path, not a relative path. This system variable implies the ssl option.

https://mariadb.com/kb/en/ssltls-system-variables/#ssl_ca

If a Galera user tries to set the ssl_ca system variable to a path to a directory, MariaDB Server is likely to encounter an error during startup when it tries to treat the value as a path to a PEM file.

However, there is an easy solution. MariaDB Server provides the ssl_capath system variable to refer to a directory:

ssl_capath
Description: Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for TLS. This system variable requires that you use the absolute path, not a relative path. The directory specified by this variable needs to be run through the openssl rehash command. This system variable implies the ssl option.

https://mariadb.com/kb/en/ssltls-system-variables/#ssl_capath

If we would like Galera users to be able to specify a path to a directory of CA certificates, we should probably use ssl_capath for this--not ssl_ca.



 Comments   
Comment by Jan Lindström (Inactive) [ 2021-12-13 ]

In my opinion this is ok to push.

Comment by Julius Goryavsky [ 2021-12-14 ]

Fixed:
https://github.com/MariaDB/server/commit/8bb55633699612279744c055e22eeca8d4058273
https://github.com/MariaDB/server/commit/7bc629a5ce9e1edf2c27ddfba2a55c4341d55b4f
https://github.com/MariaDB/server/commit/dda0bfaaecc898d7a4b1e1234e0f5083294ccf6e

Generated at Thu Feb 08 09:50:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.