This may be fixed in the tls-1.8 and crypto branches by [1edeeb9bb0439547]. I tested what I could, but I don't have a full MinGW install to test with, only a basic MSYS2 config.