summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2018-01-20 12:19:21 (GMT)
committerGitHub <noreply@github.com>2018-01-20 12:19:21 (GMT)
commitff5be6e8100276647e0077e80869fc022d1bb53f (patch)
tree70c1b01fa7040254bf81026e177a53862e7192b4 /Modules/_ssl.c
parentd911e40e788fb679723d78b6ea11cabf46caed5a (diff)
downloadcpython-ff5be6e8100276647e0077e80869fc022d1bb53f.zip
cpython-ff5be6e8100276647e0077e80869fc022d1bb53f.tar.gz
cpython-ff5be6e8100276647e0077e80869fc022d1bb53f.tar.bz2
bpo-32598: Use autoconf to detect usable OpenSSL (#5242)
Add https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html to auto-detect compiler flags, linker flags and libraries to compile OpenSSL extensions. The M4 macro uses pkg-config and falls back to manual detection. Add autoconf magic to detect usable X509_VERIFY_PARAM_set1_host() and related functions. Refactor setup.py to use new config vars to compile _ssl and _hashlib modules. Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 380dd1b..c5eec7e 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -64,6 +64,13 @@ static PySocketModule_APIObject PySocketModule;
#include "openssl/rand.h"
#include "openssl/bio.h"
+/* Set HAVE_X509_VERIFY_PARAM_SET1_HOST for non-autoconf builds */
+#ifndef HAVE_X509_VERIFY_PARAM_SET1_HOST
+# if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER > 0x1000200fL
+# define HAVE_X509_VERIFY_PARAM_SET1_HOST
+# endif
+#endif
+
/* SSL error object */
static PyObject *PySSLErrorObject;
static PyObject *PySSLCertVerificationErrorObject;