You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/content/driver/tutorials/ssl.md
+46
Original file line number
Diff line number
Diff line change
@@ -201,3 +201,49 @@ ERefGuide.html).
201
201
Some applications may want to force only the TLS 1.2 protocol. To do this, set the `jdk.tls.client.protocols` system property to "TLSv1.2".
202
202
203
203
Java runtime environments prior to Java 8 started to enable the TLS 1.2 protocol only in later updates, as shown in the previous section. For the driver to force the use of the TLS 1.2 protocol with a Java runtime environment prior to Java 8, ensure that the update has TLS 1.2 enabled.
204
+
205
+
206
+
## OCSP
207
+
208
+
{{% note %}}
209
+
The Java driver cannot enable OCSP by default on a per MongoClient basis.
210
+
{{% /note %}}
211
+
212
+
### Client-driven OCSP
213
+
214
+
An application will need to set JVM system and security properties to ensure that client-driven OCSP is enabled:
215
+
216
+
-`com.sun.net.ssl.checkRevocation`:
217
+
When set to `true`, this system property enables revocation checking.
218
+
219
+
-`ocsp.enable`:
220
+
When set to `true`, this security property enables client-driven OCSP.
221
+
222
+
To configure an application to use client-driven OCSP, the application must already be set up to connect to a server using TLS. Setting these system properties is required to enable client-driven OCSP.
223
+
224
+
{{% note %}}
225
+
The support for TLS provided by the JDK utilizes “hard fail” behavior in the case of an unavailable OCSP responder in contrast to the mongo shell and drivers that utilize “soft fail” behavior.
226
+
{{% /note %}}
227
+
228
+
### OCSP Stapling
229
+
230
+
{{% note class=important %}}
231
+
The following exception may occur when using OCSP stapling with Java runtime environments that use the TLS 1.3 protocol (Java 11 and higher use TLS 1.3 by default):
232
+
233
+
`javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request`
234
+
235
+
The exception is due to a known issue with TLS 1.3 in Java 11 and higher. To avoid this exception when using a Java runtime environments using the TLS 1.3 protocol, you can force the application to use the TLS 1.2 protocol. To do this, set the `jdk.tls.client.protocols` system property to "TLSv1.2".
236
+
{{% /note %}}
237
+
238
+
An application will need to set several JVM system properties to set up OCSP stapling:
239
+
240
+
-`jdk.tls.client.enableStatusRequestExtension`:
241
+
When set to `true` (its default value), this enables OCSP stapling.
242
+
243
+
-`com.sun.net.ssl.checkRevocation`:
244
+
When set to `true`, this enables revocation checking. If this property is not set to `true`, then the connection will be allowed to proceed regardless of the presence or status of the revocation information.
245
+
246
+
To configure an application to use OCSP stapling, the application must already be set up to connect to a server using TLS, and the server must be set up to staple an OCSP response to the certificate it returns as part of the the TLS handshake.
247
+
248
+
For more information on configuring a Java application to use OCSP, please
249
+
refer to the "Client-driven OCSP and OCSP Stapling" section in the [`JSSE Reference Guide`](https://docs.oracle.com/javase/9/security/java-secure-socket-extension-jsse-reference-guide.htm).
0 commit comments