From 9a64fa6532d62c295b5030415886374540c97087 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Mon, 14 Feb 2022 22:05:32 +0000
Subject: [PATCH] Fix libcurl builds with MinGW

---
 sdk/recipes/patches/libcurl/lib.vtls.openssl.c.p | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 sdk/recipes/patches/libcurl/lib.vtls.openssl.c.p

diff --git a/sdk/recipes/patches/libcurl/lib.vtls.openssl.c.p b/sdk/recipes/patches/libcurl/lib.vtls.openssl.c.p
new file mode 100644
index 0000000..682211c
--- /dev/null
+++ b/sdk/recipes/patches/libcurl/lib.vtls.openssl.c.p
@@ -0,0 +1,12 @@
+--- lib/vtls/openssl.c.orig	2021-04-12 09:04:07.000000000 +0100
++++ lib/vtls/openssl.c	2021-09-12 19:15:37.380253943 +0100
+@@ -2885,8 +2885,7 @@
+   if((SSL_CONN_CONFIG(verifypeer) || SSL_CONN_CONFIG(verifyhost)) &&
+      (SSL_SET_OPTION(native_ca_store))) {
+     X509_STORE *store = SSL_CTX_get_cert_store(backend->ctx);
+-    HCERTSTORE hStore = CertOpenSystemStore((HCRYPTPROV_LEGACY)NULL,
+-                                            TEXT("ROOT"));
++    HCERTSTORE hStore = CertOpenSystemStore(0, TEXT("ROOT"));
+ 
+     if(hStore) {
+       PCCERT_CONTEXT pContext = NULL;
-- 
2.30.2

