From d79b6b6c33e0c711819b8210787e7ee449ddf3c4 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 7 Jul 2024 17:21:54 -0700 Subject: [PATCH] Ensure `rails public_data:pull` doesn't use SSL for localhost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I upgraded our local MariaDB for compatibility with the latest server dumps (https://mariadb.org/mariadb-dump-file-compatibility-change/), and I thiiiink what I'm seeing is that, also in this version of MariaDB, the default value for the `ssl` option is `true`? That is, command-line clients will try to connect over SSL by default—which isn't generally supported on development servers, where this task runs. I could probably fix this with a change to my local config? But I figure I can't really picture a scenario where this option being set in the task would be *wrong*, but I *can* see it saving future people time if they're working in a similar environment. So, let's just set it! --- lib/tasks/public_data.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/public_data.rake b/lib/tasks/public_data.rake index 789611da..39b2a21a 100644 --- a/lib/tasks/public_data.rake +++ b/lib/tasks/public_data.rake @@ -74,6 +74,7 @@ namespace :public_data do # The connection details for our database! config = ApplicationRecord.connection_db_config.configuration_hash args << "--host=#{config[:host]}" if config[:host] + args << "--ssl=false" # SSL is the default for recent MariaDB; override! args << "--user=#{config[:username]}" if config[:username] args << "--password=#{config[:password]}" if config[:password] args << "--database=#{config.fetch(:database)}"