summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-02-27 11:24:30 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-02-27 11:24:59 +0000
commit934e6a3b40ff98d34741bd5ed12a2ceb1f708398 (patch)
treeac73a33941fe2508bea5ce290fa18be00456c22d
parent8c8db98078b97404cb731e53bd02c9dab3b89d7c (diff)
downloadlibgit2-934e6a3b40ff98d34741bd5ed12a2ceb1f708398.tar.gz
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`.
-rw-r--r--src/transports/winhttp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index 1e83a3f26..07e8163e1 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -40,6 +40,14 @@
#define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0
#endif
+#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS_1_1
+# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
+#endif
+
+#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS_1_2
+# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
+#endif
+
static const char *prefix_https = "https://";
static const char *upload_pack_service = "upload-pack";
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 |
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |
SECURITY_FLAG_IGNORE_UNKNOWN_CA;
-#if defined(__MINGW64_VERSION_MAJOR)
-# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
-# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
-#endif
-
#if defined(__MINGW32__)
static const CLSID CLSID_InternetSecurityManager_mingw =
{ 0x7B8A2D94, 0x0AC9, 0x11D1,