Alcinoe
Alcinoe copied to clipboard
HTTP Client Post gets secuirty error on Win 7
I found that using the http client, WinHttpClient.Post() with e.g. this test URL: https://api.gumroad.com/v2/licenses/verify?product_permalink=nvDcR&license_key=43ADAD8C-E98849EA-89EFF5E9-3884FC65
The request would fail with an error msg that essentially says 'security error occurred' when on Win7, but perfectly fine on Win10. I've also tested it with this demo program: https://github.com/Zeus64/alcinoe/tree/master/demos/ALWinHTTPClient/win64
On Win10, it gets the correct return:
But on Win7, it gets an error (error msg not displayed correctly):
Any one knows what's wrong?
hmm, I don't have any win 7 to check :( winhttp is made by windows. Maybe you can try to launch the app in debug and see exactly in with function (in alWinHttpClient i guess) the exception is raised to know with windows api failed ?
So, I tried also Delphi's own httpClient. Got a security error 12175 on Win 7 but fine on win10, just as reported here: https://stackoverflow.com/questions/55642128/why-i-get-error-security-error-12175-with-tnethttprequest As hinted by the above stackoverflow case, I set FClient.SecureProtocols := [THTTPSecureProtocol.TLS1, THTTPSecureProtocol.TLS11, THTTPSecureProtocol.TLS12]; and that gets rid of the error on Win7.
I've tried adding wHttpIo_SECURE to alcinoe's httpClient's option, but that doesn't fix the error on Win7. Do you know if there's any way we can choose to use TLS or SSL in alcinoe's httpClient?