@@ -122,4 +122,48 @@ following steps:
122
122
123
123
- Downgrade Python to v3.9 or earlier
124
124
- Upgrade {+mdb-server+} to v4.2 or later
125
- - Install {+driver-short+} with the :ref: `OCSP <pymongo-disable-ocsp >` option, which relies on PyOpenSSL
125
+ - Install {+driver-short+} with the :ref: `OCSP <pymongo-disable-ocsp >` option, which relies on PyOpenSSL
126
+
127
+ Unsafe Legacy Renegotiation Disabled
128
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129
+
130
+ When using OpenSSL v3 or later, you might see an error similar to the following
131
+ message:
132
+
133
+ .. code-block :: python
134
+
135
+ 886E0000 :error:0A000152 :SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\ws\deps\openssl\openssl\ssl\statem\extensions.c:922:
136
+
137
+ These types of errors occur due to outdated or buggy SSL proxies that mistakenly
138
+ enforce legacy TLS renegotiation.
139
+
140
+ To resolve this issue, use the ``UnsafeLegacyServerConnect `` option with the
141
+ ``OPENSSL_CONF `` environment variable. To do this, create a configuration
142
+ file with the following content:
143
+
144
+ .. code-block :: shell
145
+
146
+ openssl_conf = openssl_init
147
+
148
+ [openssl_init]
149
+ ssl_conf = ssl_sect
150
+
151
+ [ssl_sect]
152
+ system_default = system_default_sect
153
+
154
+ [system_default_sect]
155
+ Options = UnsafeLegacyServerConnect
156
+
157
+ Then run Python using that OpenSSL config file:
158
+
159
+ .. code-block :: shell
160
+
161
+ OPENSSL_CONF=/path/to/the/config/file/above.cnf python ...
162
+
163
+ The ``UnsafeLegacyServerConnect `` option in ``OPENSSL_CONF `` requires OpenSSL v3.0.4
164
+ or greater.
165
+
166
+ .. warning ::
167
+
168
+ This workaround should only be used as a last resort to address ``unsafe legacy
169
+ renegotiation disabled `` errors.
0 commit comments