Skip to content

Commit 9c49824

Browse files
committed
schannel_verify: Fix concurrent openings of CA file
- Open the CA file using FILE_SHARE_READ mode so that others can read from it as well. Prior to this change our schannel code opened the CA file without sharing which meant concurrent openings (eg an attempt from another thread or process) would fail during the time it was open without sharing, which in curl's case would cause error: "schannel: failed to open CA file". Bug: https://curl.haxx.se/mail/lib-2019-10/0104.html Reported-by: Richard Alcock
1 parent c2b01cc commit 9c49824

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/vtls/schannel_verify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static CURLcode add_certs_to_store(HCERTSTORE trust_store,
111111
*/
112112
ca_file_handle = CreateFile(ca_file_tstr,
113113
GENERIC_READ,
114-
0,
114+
FILE_SHARE_READ,
115115
NULL,
116116
OPEN_EXISTING,
117117
FILE_ATTRIBUTE_NORMAL,

0 commit comments

Comments
 (0)