Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c8db98

Browse files
committed
mingw: update TLS option flags
Include the constants for `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1` and `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2` so that they can be used by mingw. This updates both the `deps/winhttp` framework (for classic mingw) and adds the defines for mingw64, which does not use that framework.
1 parent 7d90637 commit 8c8db98

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

deps/winhttp/winhttp.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,12 @@ typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
437437
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040
438438
#define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000
439439

440-
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008
441-
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020
442-
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080
443-
#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)
440+
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008
441+
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020
442+
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080
443+
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
444+
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
445+
#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)
444446

445447
#define WINHTTP_AUTH_SCHEME_BASIC 0x00000001
446448
#define WINHTTP_AUTH_SCHEME_NTLM 0x00000002

src/transports/winhttp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ static const int no_check_cert_flags = SECURITY_FLAG_IGNORE_CERT_CN_INVALID |
5555
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |
5656
SECURITY_FLAG_IGNORE_UNKNOWN_CA;
5757

58+
#if defined(__MINGW64_VERSION_MAJOR)
59+
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
60+
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
61+
#endif
62+
5863
#if defined(__MINGW32__)
5964
static const CLSID CLSID_InternetSecurityManager_mingw =
6065
{ 0x7B8A2D94, 0x0AC9, 0x11D1,

0 commit comments

Comments
 (0)