diff options
| author | Alexandru Ardelean <ardeleanalex@gmail.com> | 2019-09-11 20:23:28 +0300 |
|---|---|---|
| committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-11 10:23:28 -0700 |
| commit | 0d63669e52dd7e95708ec14e9e3e07d7dc9cd913 (patch) | |
| tree | c11433638b6ffd7bd89f64226f022578c82c7ae5 | |
| parent | f9db011c323556ec68761263c6b91b2f75ca95ba (diff) | |
| download | cpython-git-0d63669e52dd7e95708ec14e9e3e07d7dc9cd913.tar.gz | |
[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 <ardeleanalex@gmail.com>
https://bugs.python.org/issue35264
| -rw-r--r-- | Misc/NEWS.d/next/Build/2018-11-16-15-19-09.bpo-35264.h5GxH3.rst | 1 | ||||
| -rw-r--r-- | Modules/_ssl.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Misc/NEWS.d/next/Build/2018-11-16-15-19-09.bpo-35264.h5GxH3.rst b/Misc/NEWS.d/next/Build/2018-11-16-15-19-09.bpo-35264.h5GxH3.rst new file mode 100644 index 0000000000..d17968a52d --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-11-16-15-19-09.bpo-35264.h5GxH3.rst @@ -0,0 +1 @@ +Fix SSL module build with OpenSSL 1.1.0 diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 93b635cc4a..98c8a5a4a9 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1590,7 +1590,7 @@ static PyObject *PySSL_version(PySSLSocket *self) return PyUnicode_FromString(version); } -#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG) +#if HAVE_NPN static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) { const unsigned char *out; unsigned int outlen; @@ -2118,7 +2118,7 @@ static PyMethodDef PySSLMethods[] = { PySSL_peercert_doc}, {"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS}, {"version", (PyCFunction)PySSL_version, METH_NOARGS}, -#ifdef OPENSSL_NPN_NEGOTIATED +#if HAVE_NPN {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol, METH_NOARGS}, #endif #if HAVE_ALPN |
