From bab4969264250abca836e85a9c332c42be573dfc Mon Sep 17 00:00:00 2001 From: Ryan Tin Date: Thu, 15 Oct 2020 11:43:45 +0800 Subject: [PATCH] Updated README SSL documentation (#1142) Co-Authored-By: Aaron Stone --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa41fb57..61e76297 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,6 @@ Mysql2::Client.new( :reconnect = true/false, :local_infile = true/false, :secure_auth = true/false, - :ssl_mode = :disabled / :preferred / :required / :verify_ca / :verify_identity, :default_file = '/path/to/my.cfg', :default_group = 'my.cfg section', :default_auth = 'authentication_windows_client' @@ -268,8 +267,13 @@ Setting any of the following options will enable an SSL connection, but only if your MySQL client library and server have been compiled with SSL support. MySQL client library defaults will be used for any parameters that are left out or set to nil. Relative paths are allowed, and may be required by managed -hosting providers such as Heroku. Set `:sslverify => true` to require that the -server presents a valid certificate. +hosting providers such as Heroku. + +For MySQL versions 5.7.11 and higher, use `:ssl_mode` to prefer or require an +SSL connection and certificate validation. For earlier versions of MySQL, use +the `:sslverify` boolean. For details on each of the `:ssl_mode` options, see +[https://dev.mysql.com/doc/refman/8.0/en/connection-options.html](https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_ssl-mode). + ``` ruby Mysql2::Client.new( @@ -279,7 +283,8 @@ Mysql2::Client.new( :sslca => '/path/to/ca-cert.pem', :sslcapath => '/path/to/cacerts', :sslcipher => 'DHE-RSA-AES256-SHA', - :sslverify => true, + :sslverify => true, # Removed in MySQL 8.0 + :ssl_mode = :disabled / :preferred / :required / :verify_ca / :verify_identity, ) ```