File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ The :mod: `ssl ` and :mod: `hashlib ` modules now actively check that OpenSSL is
2
+ build with thread support. Python 3.7.0 made thread support mandatory and no
3
+ longer works safely with a no-thread builds.
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ module _hashlib
32
32
[clinic start generated code]*/
33
33
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c2b4ff081bac4be1]*/
34
34
35
+ #ifndef OPENSSL_THREADS
36
+ # error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
37
+ #endif
38
+
35
39
#define MUNCH_SIZE INT_MAX
36
40
37
41
#ifndef HASH_OBJ_CONSTRUCTOR
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ static PySocketModule_APIObject PySocketModule;
75
75
# endif
76
76
#endif
77
77
78
+ #ifndef OPENSSL_THREADS
79
+ # error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
80
+ #endif
81
+
78
82
/* SSL error object */
79
83
static PyObject * PySSLErrorObject ;
80
84
static PyObject * PySSLCertVerificationErrorObject ;
@@ -5875,7 +5879,7 @@ PyInit__ssl(void)
5875
5879
if (!_setup_ssl_threads ()) {
5876
5880
return NULL ;
5877
5881
}
5878
- #elif OPENSSL_VERSION_1_1 && defined( OPENSSL_THREADS )
5882
+ #elif OPENSSL_VERSION_1_1
5879
5883
/* OpenSSL 1.1.0 builtin thread support is enabled */
5880
5884
_ssl_locks_count ++ ;
5881
5885
#endif
You can’t perform that action at this time.
0 commit comments