How can I enable server certificate verification when connecting to a remote host, but not when connecting via localhost?
1
vote
0
answers
233
views
When I add
ssl-verify-server-cert
to a [client-mariadb]
section in the configuration files, the client correctly verifies the server certificate when connecting to a remote MariaDB instance.
When attempting to login on the client itself via localhost, however, login fails with a TLS validation error:
mariadb -u root -v
ERROR 2026 (HY000): TLS/SSL error: Validation of SSL server certificate failed
Removing ssl-verify-server-cert
allows logging in from localhost normally.
How can I enable server certificate verification when connecting to a remote host, but not when connecting via localhost?
I presume the error is because localhost
is not the domain in the certificate on the client machine. But I also feel that adding localhost
as a Subject Alt Name is probably not a good idea.
Is there a solution or recommended practice for this?
Asked by Nick
(301 rep)
Oct 25, 2023, 09:57 AM