Skip to content

Commit de043a6

Browse files
p-mongop
andauthored
Move TLS notes to compatibility page (#2225)
Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 24042c1 commit de043a6

File tree

5 files changed

+93
-63
lines changed

5 files changed

+93
-63
lines changed

source/includes/ruby-driver-compatibility-full-language.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

source/includes/ruby-driver-compatibility-full-mongodb.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

source/includes/ruby-driver-compatibility-matrix-mongodb.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

source/installation.txt

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,47 @@ Installation
44

55
.. default-domain:: mongodb
66

7-
The Ruby driver is bundled as a gem and is hosted on `Rubygems
7+
The Ruby driver is released as a gem hosted on `Rubygems
88
<https://rubygems.org/gems/mongo>`_.
99

1010

11+
Prerequisites
12+
=============
13+
14+
Please see the :ref:`compatibility <compatibility>` page for the list of
15+
Ruby versions and MongoDB server versions that this release of the Ruby
16+
driver is compatible with.
17+
18+
The driver itself is written entirely in Ruby, however it depends on the
19+
`bson library <https://rubygems.org/gems/bson>`_ which includes a C extension
20+
for MRI and a compiled Java extension for JRuby. A working C compiler and Ruby
21+
development headers and libraries are required when installing on MRI.
22+
When installing on JRuby, JRE is sufficient because the ``bson`` gem includes
23+
the compiled extension.
24+
25+
Connecting to TLS-enabled MongoDB servers, using SCRAM authentication
26+
(both SCRAM-SHA-1 and SCRAM-SHA-256) and using X.509 authentication (which
27+
is performed over a TLS connection) requires the Ruby ``openssl`` extension
28+
to be present and working. The :ref:`TLS compatibility <tls-compatibility>`
29+
section provides further details on usage of newer TLS protocols like TLS 1.1.
30+
31+
1132
.. _ruby-driver-install:
1233

1334
Install the Gem
1435
===============
1536

16-
The driver can be installed manually or with bundler.
37+
Add ``mongo`` to your ``Gemfile``:
38+
39+
.. code-block:: ruby
1740

18-
To install the mongo gem manually:
41+
gem "mongo", "~> 2"
42+
43+
To install the driver manually:
1944

2045
.. code-block:: sh
2146

22-
gem install mongo -v 2.15.0.alpha
47+
gem install mongo -v '~> 2'
2348

2449

2550
What's New
@@ -28,43 +53,3 @@ What's New
2853
Please consult the `releases page on GitHub
2954
<https://github.com/mongodb/mongo-ruby-driver/releases>`_ for the list
3055
of improvements and changes in each version of the driver.
31-
32-
33-
TLS/SSL and the Ruby Driver
34-
===========================
35-
36-
Industry best practices, and some regulations, require the use of TLS 1.1
37-
or newer. Though no application changes are required for the Ruby driver to
38-
make use of the newest protocols, some operating systems or versions may
39-
not provide an OpenSSL version new enough to support them.
40-
41-
Users of macOS older than 10.13 (High Sierra) will need to install Ruby from
42-
`rvm`_, `homebrew`_, `macports`_, or another similar source. See
43-
`installation information on ruby-lang.org`_ for more options.
44-
45-
Users of Linux or other non-macOS Unix can check their OpenSSL version like this:
46-
47-
.. code-block:: sh
48-
49-
$ openssl version
50-
51-
If the version number is less than 1.0.1 support for TLS 1.1 or newer is
52-
not available. Contact your operating system vendor for a solution or upgrade
53-
to a newer distribution.
54-
55-
You can check your Ruby interpreter by executing the following command:
56-
57-
.. code-block:: sh
58-
59-
ruby -e "require 'net/http'; require 'json'; puts JSON.parse(Net::HTTP.get(URI('https://www.howsmyssl.com/a/check')))['tls_version']"
60-
61-
You should see "TLS 1.X" where X is >= 1.
62-
63-
You can read more about TLS versions and their security implications here:
64-
65-
`<https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols>`_
66-
67-
.. _rvm: https://rvm.io/
68-
.. _homebrew: https://brew.sh/
69-
.. _macports: https://www.macports.org/
70-
.. _installation information on ruby-lang.org: https://www.ruby-lang.org/en/documentation/installation

source/reference/driver-compatibility.txt

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _reference-compatibility-ruby:
1+
.. _compatibility:
22

33
********************
44
Driver Compatibility
@@ -12,12 +12,23 @@ Driver Compatibility
1212
:depth: 1
1313
:class: singlecol
1414

15-
.. _reference-compatibility-mongodb-ruby:
15+
16+
.. _mongodb-compatibility:
1617

1718
MongoDB Compatibility
1819
=====================
1920

20-
.. include:: /includes/ruby-driver-compatibility-matrix-mongodb.rst
21+
The following compatibility table specifies the recommended
22+
version(s) of the MongoDB Ruby driver for use with a specific version of
23+
MongoDB. Except when indicated, the specified driver versions expose or
24+
take advantage of the features added in the corresponding server versions.
25+
26+
MongoDB server releases are generally backwards compatible, meaning a
27+
particular version of the driver will generally work with newer versions of
28+
the server but may not take advantage of the functionality released in the
29+
newer version of the server.
30+
31+
The first column lists the driver versions.
2132

2233
.. list-table::
2334
:header-rows: 1
@@ -184,7 +195,8 @@ MongoDB Compatibility
184195

185196
The driver does not support older versions of MongoDB.
186197

187-
.. _reference-compatibility-language-ruby:
198+
199+
.. _ruby-compatibility:
188200

189201
Ruby Compatibility
190202
==================
@@ -426,6 +438,7 @@ for that Ruby version is deprecated.
426438

427439
The driver does not support older versions of Ruby.
428440

441+
429442
Rails/ActiveSupport Compatibility
430443
=================================
431444

@@ -442,6 +455,52 @@ compatibility code for behavior like time serialization to be correct:
442455
Applications using Mongoid 7.0.6 or newer do not need to explicitly load
443456
the driver's ActiveSupport code, since Mongoid automatically does so.
444457

458+
459+
.. _tls-compatibility:
460+
461+
TLS/SSL Compatibility
462+
=====================
463+
464+
The driver will utilize the protocols supported by the underlying Ruby
465+
``openssl`` extension. In turn, the ``openssl`` extension generally exposes
466+
the functionality that exists in the operating system's OpenSSL library.
467+
468+
Industry best practices, and some regulations, require the use of TLS 1.1
469+
or newer. Some operating systems or versions may not provide an OpenSSL version
470+
new enough to support these TLS versions.
471+
472+
Users of macOS older than 10.13 (High Sierra) will need to install Ruby from
473+
`rvm`_, `homebrew`_, `macports`_, or another similar source. See
474+
`installation information on ruby-lang.org`_ for more options.
475+
476+
Users of Linux or other non-macOS Unix can check their OpenSSL version
477+
as follows:
478+
479+
.. code-block:: sh
480+
481+
openssl version
482+
483+
If the version number is less than 1.0.1 support for TLS 1.1 or newer is
484+
not available. Contact your operating system vendor for a solution or upgrade
485+
to a newer distribution.
486+
487+
You can check your Ruby interpreter by executing the following command:
488+
489+
.. code-block:: sh
490+
491+
ruby -e "require 'net/http'; require 'json'; puts JSON.parse(Net::HTTP.get(URI('https://www.howsmyssl.com/a/check')))['tls_version']"
492+
493+
You should see "TLS 1.X" where X is >= 1.
494+
495+
You can read more about TLS versions and their security implications `here
496+
<https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols>`_.
497+
498+
.. _rvm: https://rvm.io/
499+
.. _homebrew: https://brew.sh/
500+
.. _macports: https://www.macports.org/
501+
.. _installation information on ruby-lang.org: https://www.ruby-lang.org/en/documentation/installation
502+
503+
445504
Atlas Compatibility
446505
===================
447506

@@ -454,6 +513,7 @@ When running on JRuby and connecting to Atlas Free Tier,
454513
`driver version 2.6.4 <https://github.com/mongodb/mongo-ruby-driver/releases/tag/v2.6.4>`_
455514
or higher and Java 8 or higher are required.
456515

516+
457517
``mongo_kerberos`` Compatibility
458518
================================
459519

0 commit comments

Comments
 (0)