Skip to content

Commit 150af75

Browse files
authored
bpo-43788: Generate version specific _ssl_data.h (GH-25300)
Signed-off-by: Christian Heimes <[email protected]> Automerge-Triggered-By: GH:tiran
1 parent 5151d64 commit 150af75

File tree

7 files changed

+15092
-82
lines changed

7 files changed

+15092
-82
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The header files for :mod:`ssl` error codes are now OpenSSL
2+
version-specific. Exceptions will now show correct reason and library
3+
codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's
4+
text file with error codes.

Modules/_ssl.c

+6
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ static void _PySSLFixErrno(void) {
135135
#endif
136136

137137
/* Include generated data (error codes) */
138+
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
139+
#include "_ssl_data_300.h"
140+
#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
141+
#include "_ssl_data_111.h"
142+
#else
138143
#include "_ssl_data.h"
144+
#endif
139145

140146
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
141147
# define OPENSSL_VERSION_1_1 1

0 commit comments

Comments
 (0)