@@ -24,14 +24,6 @@ In this guide, you can learn how to use the
24
24
:wikipedia:`TLS <w/index.php?title=Transport_Layer_Security&oldid=1239598620>`
25
25
security protocol when connecting to MongoDB by using the {+driver-short+}.
26
26
27
- .. note:: Debugging TLS
28
-
29
- If you experience trouble setting up your TLS connection, you can
30
- use the ``-Djavax.net.debug=all`` system property to view helpful
31
- log statements. See `Debugging SSL/TLS connections
32
- <https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/ReadDebug.html>`__
33
- in the Java language documentation for more information.
34
-
35
27
.. _kotlin-sync-tls-enable:
36
28
37
29
Enable TLS
@@ -59,8 +51,8 @@ in the following ways:
59
51
.. tab:: Connection String
60
52
:tabid: connectionstring
61
53
62
- To enable TLS on a connection by using a connection string, set the connection string
63
- parameter ``tls`` to ``true`` in the connection string passed to
54
+ To enable TLS on a connection by using a connection string, set the
55
+ ``tls`` option to ``true`` in the options parameter and pass the string to
64
56
``MongoClient.create()``, as shown in the following code:
65
57
66
58
.. literalinclude:: /includes/connect/tls.kt
@@ -84,6 +76,14 @@ in the following ways:
84
76
:copyable:
85
77
:dedent:
86
78
79
+ .. note:: Debugging TLS
80
+
81
+ If you experience trouble setting up your TLS connection, you can
82
+ use the ``-Djavax.net.debug=all`` system property to view helpful
83
+ log statements. See `Debugging SSL/TLS connections
84
+ <https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/ReadDebug.html>`__
85
+ in the Java language documentation for more information.
86
+
87
87
.. _tls_configure-certificates:
88
88
89
89
Configure Certificates
@@ -106,7 +106,7 @@ Configure the JVM Trust Store
106
106
107
107
By default, the JRE includes many commonly used public certificates
108
108
from signing authorities such as `Let's Encrypt
109
- <https://letsencrypt.org/>`__. As a result, you can connect to a
109
+ <https://letsencrypt.org/>`__. As a result, you can enable TLS when connecting to a
110
110
:atlas:`MongoDB Atlas </>` instance, or any other
111
111
server whose certificate is signed by an authority in the JRE's default
112
112
certificate store, with TLS enabled without configuring the trust store.
@@ -147,11 +147,6 @@ Configure the JVM Key Store
147
147
validation. You must configure the key store if you configured your MongoDB
148
148
instance to validate client certificates.
149
149
150
- The JVM key store saves certificates that securely identify your {+language+}
151
- application to other applications. By using these certificates, other
152
- applications can prove that the connection to your application is
153
- genuine and secure from tampering by third parties.
154
-
155
150
An application that initiates TLS requests must set the following JVM system
156
151
properties to ensure that the client presents a TLS certificate to
157
152
the MongoDB server:
@@ -180,7 +175,7 @@ You can configure a client-specific trust store and key store by using the
180
175
``init()`` method of the ``SSLContext`` class.
181
176
182
177
Find an example showing how to configure a client to use an ``SSLContext``
183
- instance in the :ref:`Customize TLS Configuration with an SSLContext section of this guide <kotlin-sync-tls-custom-sslContext>`.
178
+ instance in the :ref:`<kotlin-sync-tls-custom-sslContext>` section of this guide .
184
179
185
180
Disable Hostname Verification
186
181
-----------------------------
@@ -210,7 +205,7 @@ Restrict Connections to TLS 1.2 Only
210
205
------------------------------------
211
206
212
207
To restrict your application to use only the TLS 1.2 protocol, set the
213
- ``jdk.tls.client.protocols`` system property to "TLSv1.2".
208
+ ``jdk.tls.client.protocols`` system property to `` "TLSv1.2"`` .
214
209
215
210
.. note::
216
211
0 commit comments