[MDEV-23772] Automate SSL connection tests for MariaDB Created: 2020-09-21 Updated: 2021-05-09 Resolved: 2021-05-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Debian |
| Fix Version/s: | 10.5.8 |
| Type: | Task | Priority: | Major |
| Reporter: | Otto Kekäläinen | Assignee: | Otto Kekäläinen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
There are various bugs open about TLS connection issues in Debian and Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.3/+bug/1885632
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921151
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927289
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956401
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956810
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875457
The biggest problem right now is that we don't know the status of these issues. We should extend the debian/salsa-ci.yml to do a simple TLS scenario and test the connection so we know if it even works in the most basic case. |
| Comments |
| Comment by Faustin Lammler [ 2020-09-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi otto! Tested with:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-09-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As a side note, did you notice we have in `mysql-test/std_data/` already existing test certs the MTR uses? And inside the MTR there are already some existing test cases for testing TLS, maybe some of those can be recycled? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2020-09-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No I didn't! So have I just reinvented the wheel? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2020-09-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also FYI regarding the `ssl-verify-server-cert` option it needs a correct CN (should be hostname) of the client/server in the process of certificate generation. But this option is now disabled by default so I don't know if it should be part of the CI test. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-09-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the research. With the help of this I was able to quickly verify that our documentation and the template configs in /etc/mysql/mariadb.conf.d are aligned. I was also able to confirm that if server requires TLSv1.3, the client will fail to connect:
If the client requires the certificate the be verified it will fail with (maybe because the cert is self-signed?):
The problem is GnuTLS+MariaDB Connector C that does not support TLSv1.3. GnuTLS should support it since 2018: https://lists.gnupg.org/pipermail/gnutls-help/2018-December/004465.html WolfSSL has supported TLS v1.3 since 3.15 (now in 4.4.0 in Debian): https://www.wolfssl.com/docs/tls13/ According to https://mariadb.com/kb/en/secure-connections-overview/#tls-protocol-version-support all versions should be supported by server+wolfssl and client+gnutls but results above don't support this.. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2020-09-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
> If the client requires the certificate the be verified it will fail with (maybe because the cert is self-signed?) I believe that as long as you provide the CA (ca.pem) to the client, the verification should work (even if it's a self signed cert). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-09-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Based on your commands above, I created this snipped. Tested for mariadb.org 10.5.5, and there TLS 1.3 for both server and client works, so the TLS 1.3 not working in Debian is a Debian-specific issue. Probably due to building with -DSSL=bundled
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2020-09-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Very nice! Let me know when you have it in salsa ci, I am curious to see where you are going to insert it in the CI chain. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-09-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
WIP at https://salsa.debian.org/mariadb-team/mariadb-10.5/-/compare/master...salsa-ci%2Ftls-1.3-testing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-09-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Implemented downstream on mariadb-10.5 master https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/23376b43714be4dbb53782b3ef1fa7b7eff24daf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2020-09-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Great! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-05-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All of the mentioned issues are fixed in Debian in the 10.5 series thanks to using OpenSSL: And tested in Salsa-CI since: And upstreamed in: |