-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MARIADB_AUTO_UPGRADE=1/mariadb-upgrade not workling if ssl is enabled #592
Comments
Should be easily possible. Thanks for the bug report. |
I can confirm this too. Unfortunately, the client tools also behave different and reject to connect because of SSL/TLS issues. Btw. I'm using socket auth for the local root account. While in the previous version (10.11.8), the MariaDB client within the container worked perfectly fine, the new version fails: root@mariadb:/# mariadb
ERROR 2026 (HY000): TLS/SSL error: unable to get local issuer certificate The error changes a bit when I add the following client config to provide the Root certificate:
root@mariadb:/# mariadb
ERROR 2026 (HY000): TLS/SSL error: Validation of SSL server certificate failed Well, I've tried to include just the root in this file and up to all certs the server uses (server, intermediate, root) of course but without any luck. I guess this is because the connection (via socket) is not really using the server name from the cert. Of course a workaround is either to disable SSL/TLS or the certificate validation in the client section but none of these feels correct. Also why this change in behavior? |
Something else is at play here:
Config:
Could it be x509v1 certs - https://jira.mariadb.org/browse/MDEV-33592? I created mine with (gnutls):
|
In 11.4, In the cases outlined here, it should be implicitly turned off by maria client due to certain rules met. But if you are using an older (10.11) client with a newer (11.4) MariaDB, this won't happen. Could that be the case here? |
@grooverdan In my case I'm using a Letsencrypt-Cert created by Traefik. |
@grooverdan, I'm using not LE but my own CA infrastructure (root & intermediate), created by using XCA. Both CA certificates are ECC based ones while the leave cert is RSA. |
@grooverdan Tried your way with creating Certs by certtool. With them in my setup no problems too. But I think it should work the ways @crysknife and I do as well. Normal SSL connections (from outside) also work. |
@LinuxJedi For my unserstanding mariadb-upgrade runs in the same (11.4) container. It happens in a "fresh" setup with 11.4 too. So I think there is no older client in use. |
@grooverdan As I understand this issue should be fixed in 11.4.2 but it still happens |
The upgrade is a server in Can I get the logs when using the following options at startup just to check I'm looking in the right location.
And:
|
Here you are:
|
True, mariadb-upgrade or just the mariadb cli client runs in the same container (11.4). It is however, also true that the new default of ssl-verify-server-cert seems the culprit here. On one hand this is logical when a tcp connection is being used to connect locally to the MariaDB service via localhost or 127.0.0.1, while the certificate typically doesn't include localhost nor the private IP as SubjectAlternativeName, that such a verification fails. Is there an option for the cli clients to assume a hostname even when a socket is used to connect to the db? |
ssl-ca may help make the connection resolveable - https://mariadb.com/kb/en/ssltls-system-variables/#ssl_ca I haven't yet found and client and/server option(s) that used in combination will allow a connection to a temp server started with --skip-networking --skip-grant-tables. Even something as brute force as:
Appears to fail even without certificates specified. |
And checking it when seeing if the server is started. Closes: MariaDB#592
Here is what I have done:
while using the following files in my config dir: 99-tls.cnf
... and as I didn't mentioned this before, my certs have the x509v3 |
Thanks. For testing quay.io/danielgblack/mariadb-test:11.4 - based on #594 Seems to fail for < 11.4. 11.4+ tests are failing on timeout. I'm thinking the rest of the functionality is ok. |
Thanks, but same error again with quay.io/danielgblack/mariadb-test:
Tried to use lets-encrypt-r3.pem and isrgrootx1.pem from https://letsencrypt.org/certificates/. Didn't help.
But I think/hope that the LetsEncrypt Chain should be verified from the default Linux Truststore (/etc/ssl/certs or where ever), right? |
Hmm... my cert is created for CN: mariadb.mydomain.example.com |
I also made a mistake, suspended laptop while it was still uploading the image quay.io/danielgblack/mariadb-test:11.4 🤦 |
And checking it when seeing if the server is started. Closes: MariaDB#592
I have confirmed:
|
And checking it when seeing if the server is started. Closes: MariaDB#592
And checking it when seeing if the server is started. Closes: #592
Looks like skipping tls on sockets was intended, just not implemented. Now skipping TLS, client and server on temp_server starts. TLS authentication also disable in 11.4/11.5 healthcheck.sh. for testing: quay.io/danielgblack/mariadb-test:11.4 (tested it finished pushing this time). will submit Docker Official Images after archive.mariadb.org recovers from some rate limiting event. |
included in docker-library/official-images#16944 awaiting fix docker-library/official-images#16945 too. |
Thanks for the new version! Unfortunately the same error: |
repull the image quay.io/danielgblack/mariadb-test:11.4 image - logs don't contain these changes: https://github.com/MariaDB/mariadb-docker/pull/594/files#diff-797c4fdb036a8060304c41d292293103907b58ec36f49b63940fd2c8e6019a78 Docker Official Image release hasn't happened yet (not until US daytime) |
Thank you, after another repull the error is gone! :-) |
@crysknife: Can you confirm the fix too? I think then this issue can be closed. |
note also includes a |
I can confirm that the MariaDB upgrade works now if I don'T have any |
So for cli tools it would be:
Which I think defines the trust for for it. Probably the root only is sufficient here. The verification disable can be:
Anyway, new Docker Official Image is in the build pipeline now and should be out in a few hours. |
Moin,
I'm using mariadb:lts. While updating the container the last days the MARIADB_AUTO_UPGRADE fails if ssl is enabled:
Container output:
Switching off ssl fixes this and after mariadb-upgrade ran through i can reenable ssl and it works.
Same if I create a fresh new container with ssl enabled.
Is there a way to auto update when SSL is enabled too?
Thank you
olli
The text was updated successfully, but these errors were encountered: