Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/fundamentals/connection/tls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: is 'unsafe legacy renegotation disabled' the exact text in the error? is it capitalized there?

Copy link
Collaborator Author

@lindseymoore lindseymoore Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is how the error is written in the ticket (uncapitalized) and online in forums. Added monospace in the text if that makes it clearer that this is the verbatim error. Let me know what you think!


The {+driver-short+} depends on OpenSSL by default. You may encounter an "unsafe
legacy renegotiation disabled" error in certain environments when using OpenSSL
versions 3.0 and later, due to outdated SSL proxies. If you encounter this error,
you can set the ``SSL_OP_LEGACY_SERVER_CONNECT`` option to resolve, 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
Loading