Jonathan Ober
06/05/2024, 6:55 PMJun 5 14:24:16 osq-devfleet03 fleet[801411]: {"mysql":"could not connect to db: tls: failed to verify certificate: x509: certificate is not valid for any names, but wanted to match [REDACTED], sleeping 5s","ts":"2024-06-05T18:24:16.81599463Z"}
have messed with various tls options in fleet.conf and have not had any luck so not sure if it's fleet, the certs i was provided to point it to, or the mysql database server I'm trying to point it to.Dale Ribeiro
06/05/2024, 10:04 PMDale Ribeiro
06/05/2024, 10:11 PMJonathan Ober
06/10/2024, 12:50 PMFLEET_MYSQL_TLS_CONFIG= true
FLEET_MYSQL_ADDRESS=redactedfqdn:3306
FLEET_MY_SQL_DATABASE=redacted
FLEET_MYSQL_USERNAME=redacted
FLEET_MYSQL_PASSWORD=redacted
FLEET_MYSQL_TLS_SERVER_NAME=redactedfqdn
FLEET_MYSQL_TLS_CERT=/etc/fleet/ssl/client-cert.pem
FLEET_MYSQL_TLS_KEY=/etc/fleet/ssl/client-key.pem
FLEET_MYSQL_TLS_CA=/etc/fleet/ssl/ca.pem
is FLEET_MYSQL_TLS_SKIP_VERIFY=true
still a valid option? i dont see it in the doc you linked but came across it when googling around. i had tried setting that, but it didnt make a difference.
I think youre right about the certs not having the name in them.Dale Ribeiro
06/10/2024, 1:58 PMFLEET_MYSQL_TLS_SKIP_VERIFY
doesn't seem to be a configuration option anymore. At least, I don't see it listed here: https://github.com/fleetdm/fleet/blob/1fac823fa9496e7f8ad666582149048517342c0b/docs/Configuration/fleet-server-configuration.md?plain=1#L138
It looks like you could use FLEET_MYSQL_TLS_CONFIG=skip-verify
thoughJonathan Ober
06/11/2024, 7:33 PMopenssl x509 -in /etc/fleet/ssl/ca.pem -text -noout
:
Issuer: CN = MySQL_Server_8.0.37_Auto_Generated_CA_Certificate
Jonathan Ober
06/13/2024, 2:21 PMsystemctl status fleet
or checking /var/log/messages? If tls is turned off on the DB server, it works. just trying to see if there's anything on the fleet side at this pointDale Ribeiro
06/13/2024, 7:44 PMFLEET_MYSQL_TLS_CA
variable.
But, if you want to get more verbose logs, you can enable debug mode FLEET_LOGGING_DEBUG=true
https://fleetdm.com/docs/configuration/fleet-server-configuration#logging-fleet-server-loggingJonathan Ober
06/14/2024, 7:27 PMFLEET_MYSQL_TLS_CONFIG= skip-verify
and commenting out the certificate values. i think the problem was due to the cert being automatically generated in mysql because the subject CN was Subject: CN = MySQL_Server_8.0.37_Auto_Generated_CA_Certificate
and not the FQDN of the server. since we verified the conneciton was encrypted we decided to just leave it at that. just posting this in case anyone else has this problem