@@ -496,27 +496,30 @@ Ruby Options
496
496
- none
497
497
498
498
* - ``:ssl``
499
- - Tell the client to connect to the servers via SSL .
499
+ - Tell the client to connect to the servers via TLS .
500
500
- ``Boolean``
501
501
- false
502
502
503
503
* - ``:ssl_ca_cert``
504
- - The file path containing concatenated certificate authority certificates used to validate certs
505
- passed from the other end of the connection. One of :ssl_ca_cert, :ssl_ca_cert_string or :ssl_ca_cert_object
504
+ - The file path containing concatenated certificate authority certificates
505
+ used to validate certs passed from the other end of the connection.
506
+ One of :ssl_ca_cert, :ssl_ca_cert_string or :ssl_ca_cert_object
506
507
(in order of priority) is required for :ssl_verify.
507
508
- ``String``
508
509
- none
509
510
510
511
* - ``:ssl_ca_cert_object``
511
- - An array of OpenSSL::X509::Certificate representing the certificate authority certificates used to
512
- validate certs passed from the other end of the connection. One of :ssl_ca_cert, :ssl_ca_cert_string or
512
+ - An array of OpenSSL::X509::Certificate representing the certificate
513
+ authority certificates used to validate certs passed from the other end
514
+ of the connection. One of :ssl_ca_cert, :ssl_ca_cert_string or
513
515
:ssl_ca_cert_object (in order of priority) is required for :ssl_verify.
514
516
- ``Array< OpenSSL::X509::Certificate >``
515
517
- none
516
518
517
519
* - ``:ssl_ca_cert_string``
518
- - A string containing concatenated certificate authority certificates used to validate certs
519
- passed from the other end of the connection. One of :ssl_ca_cert, :ssl_ca_cert_string or :ssl_ca_cert_object
520
+ - A string containing concatenated certificate authority certificates
521
+ used to validate certs passed from the other end of the connection.
522
+ One of :ssl_ca_cert, :ssl_ca_cert_string or :ssl_ca_cert_object
520
523
(in order of priority) is required for :ssl_verify.
521
524
- ``String``
522
525
- none
@@ -578,8 +581,9 @@ Ruby Options
578
581
- none
579
582
580
583
* - ``:ssl_key_string``
581
- - A string containing the PEM-encoded private key used to identify the connection against MongoDB.
582
- This parameter, if present, takes precedence over the value of option :ssl_key_object.
584
+ - A string containing the PEM-encoded private key used to identify the
585
+ connection against MongoDB. This parameter, if present, takes precedence
586
+ over the value of option :ssl_key_object.
583
587
- ``String``
584
588
- none
585
589
@@ -594,14 +598,16 @@ Ruby Options
594
598
- true
595
599
596
600
* - ``:ssl_verify_certificate``
597
- - Whether to perform peer certificate validation. This setting overrides :ssl_verify with
598
- respect to whether certificate validation is performed.
601
+ - Whether to perform peer certificate validation. This setting overrides
602
+ the ``:ssl_verify`` setting with respect to whether certificate
603
+ validation is performed.
599
604
- ``Boolean``
600
605
- true
601
606
602
607
* - ``:ssl_verify_hostname``
603
608
- Whether to perform peer hostname validation. This setting overrides
604
- :ssl_verify with respect to whether hostname validation is performed.
609
+ the ``:ssl_verify`` setting with respect to whether hostname validation
610
+ is performed.
605
611
- ``Boolean``
606
612
- true
607
613
@@ -811,18 +817,18 @@ URI options are explained in detail in the :manual:`Connection URI reference
811
817
* - tlsAllowInvalidCertificates=Boolean
812
818
- ``:ssl_verify_certificate => boolean``
813
819
814
- Because ``tlsAllowInvalidCertificates`` uses ``true`` to signify that verification
815
- should be disabled and ``ssl_verify_certificate`` uses ``false`` to signify that
816
- verification should be disabled, the boolean is inverted before being used to set
817
- ``ssl_verify_certificate``.
820
+ Because ``tlsAllowInvalidCertificates`` uses ``true`` to signify that
821
+ verification should be disabled and ``ssl_verify_certificate`` uses
822
+ ``false`` to signify that verification should be disabled, the boolean
823
+ is inverted before being used to set ``ssl_verify_certificate``.
818
824
819
825
* - tlsAllowInvalidHostnames=Boolean
820
826
- ``:ssl_verify_hostname => boolean``
821
827
822
- Because ``tlsAllowInvalidHostnames`` uses ``true`` to signify that verification
823
- should be disabled and ``ssl_verify_hostname`` uses ``false`` to signify that
824
- verification should be disabled, the boolean is inverted before being used to set
825
- ``ssl_verify_hostname``.
828
+ Because ``tlsAllowInvalidHostnames`` uses ``true`` to signify that
829
+ verification should be disabled and ``ssl_verify_hostname`` uses
830
+ ``false`` to signify that verification should be disabled, the boolean
831
+ is inverted before being used to set ``ssl_verify_hostname``.
826
832
827
833
* - tlsCAFile=String
828
834
- ``:ssl_ca_cert => String``
@@ -847,9 +853,10 @@ URI options are explained in detail in the :manual:`Connection URI reference
847
853
* - tlsInsecure=Boolean
848
854
- ``:ssl_verify => boolean``
849
855
850
- Because tlsInsecure uses ``true`` to signify that verification should be disabled and
851
- ``ssl_verify`` uses ``false`` to signify that verification should be disabled, the boolean
852
- is inverted before being used to set ``ssl_verify``.
856
+ Because tlsInsecure uses ``true`` to signify that verification should
857
+ be disabled and ``ssl_verify`` uses ``false`` to signify that
858
+ verification should be disabled, the boolean is inverted before being
859
+ used to set ``ssl_verify``.
853
860
854
861
* - w=Integer|String
855
862
- ``{ :write_concern => { :w => Integer|String }}``
@@ -987,6 +994,20 @@ To connect to the MongoDB deployment using TLS:
987
994
988
995
When using JRuby, ECDSA certificates are not currently supported.
989
996
997
+ TLS vs SSL Option Names
998
+ -----------------------
999
+
1000
+ All MongoDB server versions supported by the Ruby driver (2.6 and higher)
1001
+ only implement TLS. 2.6 and higher servers do not use SSL.
1002
+
1003
+ For historical reasons, the Ruby option names pertaining to TLS configuration
1004
+ use the ``ssl`` rather than the ``tls`` prefix. The next major version of
1005
+ the Ruby driver (3.0) will use the ``tls`` prefix for Ruby option names.
1006
+
1007
+ The URI option names use the ``tls`` prefix, with one exception: there is
1008
+ a ``ssl`` URI option that is deprecated and equivalent to the ``tls`` URI
1009
+ option.
1010
+
990
1011
Enable TLS Connections
991
1012
----------------------
992
1013
0 commit comments