Skip to content

Commit

Permalink
DOCSP-38014 SSL Error Workaround (#942)
Browse files Browse the repository at this point in the history
* DOCSP-38014 SSL Error Workaround

* change name

* copy fix

* tech reviewer comments

* Mikes comments"
"
"
""
"
"

* monospace

* fix font
  • Loading branch information
lindseymoore authored Dec 6, 2024
1 parent 1a352c0 commit ca66d3e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/fundamentals/connection/tls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ in the following ways:
see the :manual:`SRV Connection Format </reference/connection-string/#srv-connection-format>`
section in the Server manual.

.. note:: Workaround for an "unsafe legacy renegotiation disabled" Error

The {+driver-short+} depends on OpenSSL by default. Outdated SSL proxies can
cause an ``unsafe legacy renegotiation disabled`` error in environments using
OpenSSL 3.0 or later. You can resolve this error by setting the
``SSL_OP_LEGACY_SERVER_CONNECT`` option, as shown in the following example:

.. code-block:: js
:emphasize-lines: 6

import { MongoClient } from 'mongodb';
import crypto from 'crypto';

const client = new MongoClient("mongodb+srv://...", {
secureContext: {
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT
}
});

In addition to the ``tls`` client option, the driver provides more
options to configure TLS on your connection. For **testing purposes**,
you can set the ``tlsAllowInvalidHostnames``,
Expand Down

0 comments on commit ca66d3e

Please sign in to comment.