[MDEV-20123] MDB 10.4.7 2-way (client<->server) TLS fails validation if remote connection & 'ssl_verify_server_cert' enabled Created: 2019-07-22 Updated: 2022-06-03 Resolved: 2022-06-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | SSL |
| Affects Version/s: | 10.4.6, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | pgnd | Assignee: | Oleksandr Byelkin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I run MDB,
on 2 machines on the same LAN, 'host1' & 'host2' MDB was config'd/built with
ssl certs for host1 & host2, client & server usage, are locally generated, self-signed by my own CA. @host1,
@host2
each machine is similarly config'd. host1 ssl config is,
simlarly for host2.local connect with `mysql` on host1/localhost, status is,
NOTE ssl + TLSv13 cipher in use. remote connect with `mysql` on host1->host2 FAILs@host1
@ host2
editing @host1 ssl config,
now, remote connect with `mysql` on host1->host2 WORKs
verifying certs' extended key usage,@host1 's client,
& @host2 's server,
|
| Comments |
| Comment by pgnd [ 2019-07-23 ] | |||
|
It appears that for
to work, the server (@host2) certs' "/CN" must contain/match the client (@host1) "-h <hostname>". @host2's MDB instance listens on an INTERNAL ip address, 'host2.pgnd.lan'. The certs had only the CN for the external hostname, 'host2.example.com'. Adding 'host2.pgnd.lan' to the cert's [alt_names] stanza, or generating a unique, matching cert for it, does the trick. @host1->@host2 connection, WITH 'ssl_verify_server_cert' enabled now works. | |||
| Comment by Hartmut Holzgraefe [ 2022-05-10 ] | |||
|
That is indeed the purpose of the ssl_verify_server_cert option: to verify that the CN in the server certificate, or when the SubjectAlternativeNames (SAN) extension is used: one of the SAN entries, matches the server name as given by the client in the connect call (or connect string). So "not a bug" I'd say. |