Description
We have not fully identified what the cause it but it would appear that if a curl easy handle is put to TLS on windows, it can cause hangs on shutdown on certain versions. I'm entirely unsure what causes this and the exact conditions of the hang are very mysterious.
What we know so far is that if the handle is made and put to TLS everything is fine. If the handle however did an HTTP request first, is kept in TLS the program will hang on shutdown the first time after the HTTP request is made but if the program is run a second time it succeeds and only will start blocking again after some time has passed (6 hours?). Even a computer restart does not bring the program back to hanging. We saw this with Windows 7, Windows Server 2012.
This sounds very much like something in curl itself but it's mysterious nontheless. We currently work around by resetting the handles before shutdown on all threads that have one.