Bug 295845 - mail/sqlgrey: Failed to connect databases/mysql84-server
Summary: mail/sqlgrey: Failed to connect databases/mysql84-server
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-04 09:50 UTC by epopen
Modified: 2026-06-05 03:08 UTC (History)
1 user (show)

See Also:


Attachments
mail/sqlgrey caching_sha2_password support (362 bytes, patch)
2026-06-04 09:50 UTC, epopen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description epopen 2026-06-04 09:50:27 UTC
Created attachment 271472 [details]
mail/sqlgrey caching_sha2_password support

Hi All

In my server, I using databases/mysql84-server without "mysql_native_password" plugin.

And mail/sqlgrey got failed as follows.
    Jun  4 15:16:47 mail sqlgrey: 2026/06/04-15:16:47 sqlgrey (type Net::Server::Multiplex) starting! pid(20728) 
    Jun  4 15:16:47 mail sqlgrey: Resolved [*]:2501 to [::]:2501, IPv6 
    Jun  4 15:16:47 mail sqlgrey: Binding to TCP port 2501 on host :: with IPv6 
    Jun  4 15:16:47 mail sqlgrey: Setting gid to "11212 11212" 
    Jun  4 15:16:47 mail sqlgrey: Setting uid to "11212" 
    Jun  4 15:16:47 mail sqlgrey: dbaccess: can't connect to DB: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. 
    Jun  4 15:16:47 mail sqlgrey: dbaccess: error: couldn't get now() from DB: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. 
    Jun  4 15:16:47 mail sqlgrey: dbaccess: can't connect to DB: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. 
    Jun  4 15:16:47 mail sqlgrey: dbaccess: error: couldn't access config table: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. 

I tried to fix it and generated patch in attachment for workaround.
Could verify it and update ports? 

Thanks a lot.
Comment 1 Jochen Neumeister freebsd_committer freebsd_triage 2026-06-04 12:35:50 UTC
The issue may indeed have become visible after the default MySQL version changed from 8.0 to 8.4, since MySQL 8.4 uses caching_sha2_password by default and mysql_native_password is no longer enabled by default on the server side.

That said, I am not convinced that the proposed fix is appropriate as-is. The patch unconditionally adds:

mysql_ssl=1

to every MySQL DSN, effectively forcing SSL for all sqlgrey MySQL connections.

While this may resolve the problem in the reported environment, it also changes the behavior for all existing sqlgrey installations using MySQL. I would be hesitant to commit or ship such a change without further discussion, as it introduces a global behavior change and may cause regressions in deployments where SSL is not currently configured or expected.

It may be worth investigating whether SSL support should instead be configurable, allowing administrators to enable it when required by their MySQL authentication and transport settings.
Comment 2 epopen 2026-06-05 03:08:30 UTC
Hi  Jochen Neumeister 

That's right, you are correct.
This workaround is just for personal use.
I hope it is useful for the maintainers.