]> granicus.if.org Git - python/commitdiff
bpo-32257: Add ssl.OP_NO_RENEGOTIATION (GH-5904)
authorChristian Heimes <christian@python.org>
Tue, 15 May 2018 20:25:40 +0000 (16:25 -0400)
committerNed Deily <nad@python.org>
Tue, 15 May 2018 20:25:40 +0000 (16:25 -0400)
The ssl module now contains OP_NO_RENEGOTIATION constant, available with
OpenSSL 1.1.0h or 1.1.1.

Note, OpenSSL 1.1.0h hasn't been released yet.

Signed-off-by: Christian Heimes <christian@python.org>
Doc/library/ssl.rst
Misc/NEWS.d/next/Library/2018-02-26-09-08-07.bpo-32257.6ElnUt.rst [new file with mode: 0644]
Modules/_ssl.c

index f96549427afcf05c0e944b649a3ea65f38de1dea..dcb26664feae77a0caff6c004a1c69609e6902a3 100644 (file)
@@ -803,6 +803,15 @@ Constants
       The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15,
       3.6.3 and 3.7.0 for backwards compatibility with OpenSSL 1.0.2.
 
+.. data:: OP_NO_RENEGOTIATION
+
+   Disable all renegotiation in TLSv1.2 and earlier. Do not send
+   HelloRequest messages, and ignore renegotiation requests via ClientHello.
+
+   This option is only available with OpenSSL 1.1.0h and later.
+
+   .. versionadded:: 3.7
+
 .. data:: OP_CIPHER_SERVER_PREFERENCE
 
    Use the server's cipher ordering preference, rather than the client's.
diff --git a/Misc/NEWS.d/next/Library/2018-02-26-09-08-07.bpo-32257.6ElnUt.rst b/Misc/NEWS.d/next/Library/2018-02-26-09-08-07.bpo-32257.6ElnUt.rst
new file mode 100644 (file)
index 0000000..e74c39b
--- /dev/null
@@ -0,0 +1,2 @@
+The ssl module now contains OP_NO_RENEGOTIATION constant, available with
+OpenSSL 1.1.0h or 1.1.1.
index 7670833bf5f5482702b54bb80f7158e2aa29f1c0..bf379f01a1d2bf5d418848bf0f432279cb8c7b59 100644 (file)
@@ -5845,6 +5845,10 @@ PyInit__ssl(void)
     PyModule_AddIntConstant(m, "OP_ENABLE_MIDDLEBOX_COMPAT",
                             SSL_OP_ENABLE_MIDDLEBOX_COMPAT);
 #endif
+#ifdef SSL_OP_NO_RENEGOTIATION
+    PyModule_AddIntConstant(m, "OP_NO_RENEGOTIATION",
+                            SSL_OP_NO_RENEGOTIATION);
+#endif
 
 #ifdef X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT
     PyModule_AddIntConstant(m, "HOSTFLAG_ALWAYS_CHECK_SUBJECT",