aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorneedfeed <dev@needfeed.com>2012-09-10 12:36:49 -0700
committerneedfeed <dev@needfeed.com>2012-09-10 12:36:49 -0700
commit844ea9c07e0291701215c061985652bfad097a23 (patch)
tree907f7af768db7357cee72c385fcf64b5d0f95f7a /railties
parent416884c36d1eb2f0a607ba9a54dbe39773a92f6e (diff)
downloadrails-844ea9c07e0291701215c061985652bfad097a23.tar.gz
rails-844ea9c07e0291701215c061985652bfad097a23.tar.bz2
rails-844ea9c07e0291701215c061985652bfad097a23.zip
Support MySQL SSL in rails dbconsole.
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md3
-rw-r--r--railties/lib/rails/commands/dbconsole.rb7
2 files changed, 9 insertions, 1 deletions
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']