|
| 1 | +.. _ruby-compatibility: |
| 2 | + |
| 3 | +============= |
| 4 | +Compatibility |
| 5 | +============= |
| 6 | + |
| 7 | +.. contents:: On this page |
| 8 | + :local: |
| 9 | + :backlinks: none |
| 10 | + :depth: 2 |
| 11 | + :class: singlecol |
| 12 | + |
| 13 | +.. facet:: |
| 14 | + :name: genre |
| 15 | + :values: reference |
| 16 | + |
| 17 | +.. meta:: |
| 18 | + :keywords: backwards compatibility, versions, upgrade |
| 19 | + |
| 20 | +MongoDB Compatibility |
| 21 | +--------------------- |
| 22 | + |
| 23 | +The following compatibility table specifies the recommended |
| 24 | +version(s) of the {+driver-long+} for use with a specific version of |
| 25 | +MongoDB. Except when indicated, the specified driver versions expose or |
| 26 | +take advantage of the features added in the corresponding server versions. |
| 27 | + |
| 28 | +MongoDB server releases are generally backwards compatible. This means a |
| 29 | +particular driver version will generally work with newer server versions but might |
| 30 | +not utilize the new functionalities in those server versions. |
| 31 | + |
| 32 | +The first column lists the driver versions. |
| 33 | + |
| 34 | +.. sharedinclude:: dbx/lifecycle-schedule-callout.rst |
| 35 | + |
| 36 | +.. include:: /includes/compatibility-table-legend-ruby.rst |
| 37 | + |
| 38 | +.. include:: /includes/mongodb-compatibility-table-ruby.rst |
| 39 | + |
| 40 | +The driver does not support older versions of MongoDB. |
| 41 | + |
| 42 | +Language Compatibility |
| 43 | +---------------------- |
| 44 | + |
| 45 | +The following compatibility table specifies the versions of Ruby supported |
| 46 | +by the various versions of the {+driver-long+}. |
| 47 | + |
| 48 | +The first column lists the driver versions. |
| 49 | + |
| 50 | +.. include:: /includes/compatibility-table-legend-ruby.rst |
| 51 | + |
| 52 | +.. include:: /includes/language-compatibility-table-ruby.rst |
| 53 | + |
| 54 | +The driver does not support older versions of Ruby. |
| 55 | + |
| 56 | +Rails/ActiveSupport Compatibility |
| 57 | +--------------------------------- |
| 58 | + |
| 59 | +The {+driver-short+} does not depend on ActiveSupport. However, if your |
| 60 | +application uses ActiveSupport or Ruby on Rails, you must load the driver's |
| 61 | +ActiveSupport compatibility code for behavior such as time serialization to be |
| 62 | +correct: |
| 63 | + |
| 64 | +.. code-block:: ruby |
| 65 | + |
| 66 | + require 'mongo' |
| 67 | + require 'mongo/active_support' |
| 68 | + |
| 69 | +Applications using Mongoid 7.0.6 or newer do not need to explicitly load |
| 70 | +the driver's ActiveSupport code, since Mongoid automatically does so. |
| 71 | + |
| 72 | +.. _tls-compatibility: |
| 73 | + |
| 74 | +TLS/SSL Compatibility |
| 75 | +---------------------- |
| 76 | + |
| 77 | +The {+driver-short+} uses the protocols supported by the underlying Ruby |
| 78 | +``openssl`` extension. The ``openssl`` extension generally exposes |
| 79 | +the functionality available in the operating system's OpenSSL library. |
| 80 | + |
| 81 | +Industry best practices, and some regulations, require the use of TLS 1.1 |
| 82 | +or newer. Some operating systems or versions might not provide an OpenSSL version |
| 83 | +that supports these TLS versions. |
| 84 | + |
| 85 | +If you use macOS older than 10.13 (High Sierra), you need to install Ruby from |
| 86 | +`rvm`_, `homebrew`_, `macports`_, or another similar source. See |
| 87 | +`Installing Ruby`_ for more options. |
| 88 | + |
| 89 | +If you use Linux or other non-macOS Unix systems, you can check your OpenSSL version |
| 90 | +as follows: |
| 91 | + |
| 92 | +.. code-block:: sh |
| 93 | + |
| 94 | + openssl version |
| 95 | + |
| 96 | +If the version number is less than 1.0.1, support for TLS 1.1 or newer is |
| 97 | +not available. Contact your operating system vendor for a solution or upgrade |
| 98 | +to a newer distribution. |
| 99 | + |
| 100 | +You can check your TLS version by running the following command: |
| 101 | + |
| 102 | +.. code-block:: sh |
| 103 | + |
| 104 | + ruby -e "require 'net/http'; require 'json'; puts JSON.parse(Net::HTTP.get(URI('https://www.howsmyssl.com/a/check')))['tls_version']" |
| 105 | + |
| 106 | +After running the command, you must see ``TLS 1.X`` where ``X`` is greater than |
| 107 | +or equal to ``1``. |
| 108 | + |
| 109 | +To learn more about TLS versions and their security implications, see `Transport Layer Security Cheat Sheet |
| 110 | +<https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html>`_. |
| 111 | + |
| 112 | +.. _rvm: https://rvm.io/ |
| 113 | +.. _homebrew: https://brew.sh/ |
| 114 | +.. _macports: https://www.macports.org/ |
| 115 | +.. _Installing Ruby: https://www.ruby-lang.org/en/documentation/installation |
| 116 | + |
| 117 | +JRuby and TLS Connections |
| 118 | +------------------------- |
| 119 | + |
| 120 | +Due to JRuby limitations: |
| 121 | + |
| 122 | +- The driver does not support ECDSA server certificates. |
| 123 | +- The driver does not perform OCSP endpoint checking. |
0 commit comments