From 844ea9c07e0291701215c061985652bfad097a23 Mon Sep 17 00:00:00 2001 From: needfeed Date: Mon, 10 Sep 2012 12:36:49 -0700 Subject: [PATCH] Support MySQL SSL in rails dbconsole. --- railties/CHANGELOG.md | 3 +++ railties/lib/rails/commands/dbconsole.rb | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index b42ef8e14a..e889f0c23c 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,5 +1,8 @@ ## Rails 4.0.0 (unreleased) ## +* rails dbconsole now can use SSL for MySQL. The database.yml options sslca, sslcert, sslcapath, sslcipher, + and sslkey now affect rails dbconsole. *Jim Kingdon and Lars Petrus* + * Correctly handle SCRIPT_NAME when generating routes to engine in application that's mounted at a sub-uri. With this behavior, you *should not* use default_url_options[:script_name] to set proper application's mount point by diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index cc0552184a..c84fa832f5 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -26,7 +26,12 @@ module Rails 'port' => '--port', 'socket' => '--socket', 'username' => '--user', - 'encoding' => '--default-character-set' + 'encoding' => '--default-character-set', + 'sslca' => '--ssl-ca', + 'sslcert' => '--ssl-cert', + 'sslcapath' => '--ssl-capath', + 'sslcipher' => '--ssh-cipher', + 'sslkey' => '--ssl-key' }.map { |opt, arg| "#{arg}=#{config[opt]}" if config[opt] }.compact if config['password'] && options['include_password']