Skip to content

Commit

Permalink
Updated README SSL documentation (brianmario#1142)
Browse files Browse the repository at this point in the history
Co-Authored-By: Aaron Stone <[email protected]>
  • Loading branch information
ultratin and sodabrew committed Dec 28, 2022
1 parent 79c6263 commit bab4969
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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(
Expand All @@ -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,
)
```

Expand Down

0 comments on commit bab4969

Please sign in to comment.