Skip to content

Commit 934e6a3

Browse files
committed
winhttp: include constants for TLS 1.1/1.2 support
For platforms that do not define `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1` and/or `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2`.
1 parent 8c8db98 commit 934e6a3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/transports/winhttp.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
#define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0
4141
#endif
4242

43+
#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS_1_1
44+
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
45+
#endif
46+
47+
#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS_1_2
48+
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
49+
#endif
50+
4351
static const char *prefix_https = "https://";
4452
static const char *upload_pack_service = "upload-pack";
4553
static const char *upload_pack_ls_service_url = "/info/refs?service=git-upload-pack";
@@ -55,11 +63,6 @@ static const int no_check_cert_flags = SECURITY_FLAG_IGNORE_CERT_CN_INVALID |
5563
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |
5664
SECURITY_FLAG_IGNORE_UNKNOWN_CA;
5765

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-
6366
#if defined(__MINGW32__)
6467
static const CLSID CLSID_InternetSecurityManager_mingw =
6568
{ 0x7B8A2D94, 0x0AC9, 0x11D1,

0 commit comments

Comments
 (0)