Gerard Nguyen and Chuck D'Antonio
61ef1e1036
fix: TLS support in MySQL connector ( #2045 )
...
* fix(mysql): respect TLS configuration in MySQL collector
The MySQL collector was ignoring the TLS field in the Database spec,
which caused TLS connections to fail even when properly configured.
This change mirrors the PostgreSQL collector pattern:
- Parse the MySQL DSN using mysql.ParseDSN
- When TLS is configured, create a tls.Config and set cfg.TLS
- Use sql.OpenDB with mysql.NewConnector when TLS is active
- Keep the existing sql.Open path for backward compatibility
Fixes: MySQL preflight fails over TLS connections
* fix(mysql): address review feedback
- Fix gofmt indentation in mysql_test.go
- Remove duplicate DSN parsing in createConnectConfig
- Add CA-cert-only TLS test case
---------
Co-authored-by: Chuck D'Antonio <chuck@replicated.com >
2026-05-22 12:35:15 +10:00
..
2025-10-08 10:22:11 -07:00
2025-10-08 10:22:11 -07:00
2025-07-09 20:58:47 -04:00
2024-02-26 14:30:21 -08:00
2023-07-17 17:05:05 +12:00
2026-05-13 22:57:16 +01:00
2022-10-14 12:29:59 -04:00
2026-04-14 11:22:55 -04:00
2026-04-14 11:22:55 -04:00
2025-11-26 15:34:17 +13:00
2024-10-01 14:43:24 +10:00
2023-08-09 22:32:14 +12:00
2026-04-15 22:29:35 +01:00
2026-05-13 22:57:16 +01:00
2023-02-10 17:27:50 +00:00
2023-06-13 13:12:17 -04:00
2023-08-09 22:32:14 +12:00
2026-05-01 13:03:42 -07:00
2026-05-01 13:03:42 -07:00
2025-10-08 10:22:11 -07:00
2022-05-04 10:42:37 -07:00
2024-09-11 14:35:30 +10:00
2024-09-20 08:13:57 +10:00
2024-08-13 08:42:26 +10:00
2026-04-29 06:21:42 -07:00
2026-05-01 13:03:42 -07:00
2025-04-21 16:45:47 +00:00
2023-08-28 11:51:57 +12:00
2025-10-02 12:25:13 -07:00
2023-03-08 06:29:16 -08:00
2024-11-04 14:17:39 +11:00
2025-10-08 10:22:11 -07:00
2024-02-26 14:30:21 -08:00
2024-09-20 11:57:58 -05:00
2025-04-21 16:45:47 +00:00
2024-07-24 16:46:04 +01:00
2024-07-24 16:46:04 +01:00
2024-09-20 11:57:58 -05:00
2024-10-09 18:38:49 +13:00
2026-04-29 10:26:18 +01:00
2023-04-05 15:43:38 +01:00
2025-10-08 10:22:11 -07:00
2024-10-10 18:59:22 +05:30
2025-02-20 16:04:03 -08:00
2022-12-24 13:42:13 +13:00
2025-02-20 16:04:03 -08:00
2024-09-30 11:22:10 +10:00
2024-09-30 11:22:10 +10:00
2022-05-12 20:09:03 +00:00
2025-10-08 10:22:11 -07:00
2024-08-22 16:47:08 -07:00
2022-05-12 20:09:03 +00:00
2025-10-08 10:22:11 -07:00
2024-10-23 18:15:08 -04:00
2025-10-08 10:22:11 -07:00
2024-11-04 14:17:39 +11:00
2024-07-29 09:44:43 +10:00
2025-10-08 10:22:11 -07:00
2024-05-27 09:55:39 +10:00
2024-11-04 14:17:39 +11:00
2025-10-08 10:22:11 -07:00
2025-10-08 10:22:11 -07:00
2022-12-24 13:42:13 +13:00
2025-02-20 16:04:03 -08:00
2024-11-21 16:03:50 +01:00
2024-11-19 17:47:24 +13:00
2025-10-08 10:22:11 -07:00
2025-02-20 13:03:53 -08:00
2025-02-20 16:04:03 -08:00
2026-04-29 10:26:18 +01:00
2026-04-29 10:26:18 +01:00
2024-01-31 12:46:01 +00:00
2025-10-08 10:22:11 -07:00
2024-11-04 14:17:39 +11:00
2023-03-10 12:52:21 +10:00
2024-09-20 11:57:58 -05:00
2024-11-07 18:18:11 +00:00
2025-10-08 10:22:11 -07:00
2024-09-20 11:57:58 -05:00
2025-10-08 10:22:11 -07:00
2025-10-08 10:22:11 -07:00
2025-10-08 10:22:11 -07:00
2024-11-04 14:17:39 +11:00
2025-10-08 10:22:11 -07:00
2025-10-08 10:22:11 -07:00
2024-10-23 18:15:08 -04:00
2025-07-09 20:58:47 -04:00
2025-10-08 10:22:11 -07:00
2022-07-08 14:53:46 -07:00
2022-07-08 14:53:46 -07:00
2023-06-09 10:26:03 +01:00
2023-06-09 10:26:03 +01:00
2024-04-02 14:59:55 +01:00
2024-04-02 14:59:55 +01:00
2023-06-06 16:48:29 -04:00
2025-04-17 10:51:07 -04:00
2025-04-17 10:51:07 -04:00
2026-04-29 06:21:42 -07:00
2023-03-27 16:06:27 +01:00
2024-01-08 17:24:41 +00:00
2026-05-22 12:35:15 +10:00
2026-05-22 12:35:15 +10:00
2023-11-16 12:51:43 +00:00
2023-11-16 12:51:43 +00:00
2022-10-03 13:53:05 -04:00
2025-10-08 10:22:11 -07:00
2023-01-03 18:05:15 +00:00
2022-11-29 17:47:52 +00:00
2026-04-30 10:12:53 +01:00
2026-04-30 10:12:53 +01:00
2025-02-13 13:16:59 -08:00
2023-01-03 18:05:15 +00:00
2026-04-15 22:29:35 +01:00
2024-02-09 08:16:32 +13:00
2025-05-09 12:54:28 -07:00
2025-03-17 16:21:28 -05:00
2025-07-25 11:30:14 -04:00
2023-12-12 11:02:41 +00:00
2024-10-31 10:44:35 +00:00
2026-04-09 11:12:34 -07:00
2026-04-09 11:12:34 -07:00
2025-06-30 10:06:14 -04:00
2025-06-30 10:06:14 -04:00
2026-04-29 06:21:42 -07:00
2026-03-12 12:38:45 -04:00
2026-03-12 12:38:45 -04:00
2023-02-24 18:24:51 +00:00
2025-01-28 21:39:39 +11:00
2025-10-10 10:24:48 -05:00