Skip to content

Commit

Permalink
Merge pull request rails#7488 from needfeed/master
Browse files Browse the repository at this point in the history
Have rails dbconsole pass sslca to the mysql command line client.
  • Loading branch information
rafaelfranca committed Sep 11, 2012
2 parents 8295663 + 844ea9c commit 616ba15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions 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
Expand Down
7 changes: 6 additions & 1 deletion railties/lib/rails/commands/dbconsole.rb
Expand Up @@ -26,7 +26,12 @@ def start
'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']
Expand Down

0 comments on commit 616ba15

Please sign in to comment.