Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d63669

Browse files
commodomiss-islington
authored andcommitted
[2.7] bpo-35264: Modules/_ssl.c: fix build with OpenSSL 1.1.0 (GH-10570)
Fixes a build error with OpenSSL 1.1.0. There is already code in the `_ssl.c` that handles all the weird cases of the NPN config macros (with various OpenSSL & LibreSSL versions). That code will provide a HAVE_NPN variable, which should be used in the rest of the code to check whether (or what) to compile regarding NPN. This change adds HAVE_NPN in the remaining places where it should have been placed. Signed-off-by: Alexandru Ardelean <[email protected]> https://bugs.python.org/issue35264
1 parent f9db011 commit 0d63669

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix SSL module build with OpenSSL 1.1.0

Modules/_ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ static PyObject *PySSL_version(PySSLSocket *self)
15901590
return PyUnicode_FromString(version);
15911591
}
15921592

1593-
#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
1593+
#if HAVE_NPN
15941594
static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) {
15951595
const unsigned char *out;
15961596
unsigned int outlen;
@@ -2118,7 +2118,7 @@ static PyMethodDef PySSLMethods[] = {
21182118
PySSL_peercert_doc},
21192119
{"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS},
21202120
{"version", (PyCFunction)PySSL_version, METH_NOARGS},
2121-
#ifdef OPENSSL_NPN_NEGOTIATED
2121+
#if HAVE_NPN
21222122
{"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol, METH_NOARGS},
21232123
#endif
21242124
#if HAVE_ALPN

0 commit comments

Comments
 (0)