[MDEV-10594] SSL hostname verification fails for SubjectAltNames Created: 2016-08-18 Updated: 2019-05-22 Resolved: 2017-04-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | SSL |
| Affects Version/s: | 5.5.50, 10.1.16 |
| Fix Version/s: | 10.1.23, 10.2.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Martin Štefany | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
The SSL hostname verification code currently fails to validate server certificates with a SubjectAltName entries.
All versions work with (dbms*):
But none works for:
Version 5.5.50 fails to connect as:
while version 10.1.16 fails to connect as:
or:
Contents of /etc/my.cnf.d/client.cnf would be as follows:
|
| Comments |
| Comment by Georg Richter [ 2017-01-24 ] | |
|
Patch attached. This will work for OpenSSL versions 1.0.2 and newer (1.0.1 eoled end of 2016). In case we want to fix it also in yassl or for older OpenSSL versions please check OpenSSL wiki | |
| Comment by Loop system developers [ 2017-06-16 ] | |
|
I think the return code from X509_check_host is handled wrongly. ssl_verify_server_cert treats only negative return values ("< 0") as valid, but the man page of X509_check_host says 1 is "a successful match". So on a successful match the #else is skipped, the error pointer is set to "SSL certificate validation failure", and the return value ends up being 1 (that is, failure). | |
| Comment by Sergei Golubchik [ 2017-06-19 ] | |
|
Right. But don't look at the attached patch. This is the actual commit that got into the source tree, it uses
|