Skip to content

Commit 170af1d

Browse files
tiranmcepl
authored andcommitted
bpo-43788: Generate version specific _ssl_data.h (pythonGH-25300) (pythonGH-25311)
(cherry picked from commit 150af75) Co-authored-by: Christian Heimes <[email protected]>
1 parent bb5b131 commit 170af1d

File tree

7 files changed

+15093
-95
lines changed

7 files changed

+15093
-95
lines changed
Lines changed: 4 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ struct py_ssl_library_code {
103103
};
104104

105105
/* Include generated data (error codes) */
106+
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
107+
#include "_ssl_data_300.h"
108+
#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
109+
#include "_ssl_data_111.h"
110+
#else
106111
#include "_ssl_data.h"
112+
#endif
107113

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

0 commit comments

Comments
 (0)