Skip to content

Commit ca66d3e

Browse files
authored
DOCSP-38014 SSL Error Workaround (#942)
* DOCSP-38014 SSL Error Workaround * change name * copy fix * tech reviewer comments * Mikes comments" " " "" " " * monospace * fix font
1 parent 1a352c0 commit ca66d3e

File tree

1 file changed

+19
-0
lines changed
  • source/fundamentals/connection

1 file changed

+19
-0
lines changed

source/fundamentals/connection/tls.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ in the following ways:
7777
see the :manual:`SRV Connection Format </reference/connection-string/#srv-connection-format>`
7878
section in the Server manual.
7979

80+
.. note:: Workaround for an "unsafe legacy renegotiation disabled" Error
81+
82+
The {+driver-short+} depends on OpenSSL by default. Outdated SSL proxies can
83+
cause an ``unsafe legacy renegotiation disabled`` error in environments using
84+
OpenSSL 3.0 or later. You can resolve this error by setting the
85+
``SSL_OP_LEGACY_SERVER_CONNECT`` option, as shown in the following example:
86+
87+
.. code-block:: js
88+
:emphasize-lines: 6
89+
90+
import { MongoClient } from 'mongodb';
91+
import crypto from 'crypto';
92+
93+
const client = new MongoClient("mongodb+srv://...", {
94+
secureContext: {
95+
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT
96+
}
97+
});
98+
8099
In addition to the ``tls`` client option, the driver provides more
81100
options to configure TLS on your connection. For **testing purposes**,
82101
you can set the ``tlsAllowInvalidHostnames``,

0 commit comments

Comments
 (0)