Socket use after close when connecting to remote HTTPS via HTTPS proxy #8193
I did this
We use ProcessStrictHandleCheckPolicy which reveals socket use after close.
I expected the following
Curl returns "Received HTTP code 502 from proxy after CONNECT" and gracefully close the HTTPS tunnel.
[curl -V output]
Windows 10 20H2
The text was updated successfully, but these errors were encountered:
Thanks, I see, but I'm only linking with curl lib in my project.
Running curl.exe built from this repo, top of master branch, the problem is still there. I added
Patch which enables strict handle check policy on Windows:
With the above policy, unpatched code crash when executed like this (with no server on port 9999):
with my PR all is fine:
The stack trace:
First I set a debug log on CloseHandle and I found out that we are closing the same handle in the place which I patched. When the code unwinds from there it triggers the
then it falls into
which is an interesting code.
A blind try to fix it with
also worked but walking the code, reading comments, I made an educated guess to fix it as submitted in my PR