I have an issue where I cannot develop on my Windows device because the curl that comes bundled with it produces

next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)

How do I know Windows curl is to blame?

Because I tried the request in git bash using the curl that comes with it and it worked with no issues. Then I tried the same request in cmd and in Postman and it failed. This issue has effectively shut down my ability to test an android app that's being developed.

So ... How do you update curl for Windows?

Does it show up under apps? No.

This is on Windows 10, mind you, so there's a curl.exe in C:\Windows\System32.

Let's see ... can I put the curl.exe that comes with Git into the PATH variable?

Yes, I can, but it just gets ignored

Can I manually copy the curl.exe from Git to C:\Windows\System32?

Of course not. Administrators don't have the right to copy or rename or do anything with files therein, it seems, even after it's asked for permission.

Or alternatively, can I somehow make Android-Studio / its emulator use the "correct" curl.exe?

  • 1
    @vssher you didn't read the question, did you? I want to update curl 7.55.1 that comes with Windows to curl curl 7.68.0 that comes with Git s.t. I can do some testing with the Android emulator. I don't want to install yet another curl version that won't resolve the issue.
    – User1291
    Mar 1, 2020 at 17:27
  • 2
    Did you put the git curl in the path before (ie in front of) C:\Windows\System32
    – DavidPostill
    Mar 1, 2020 at 17:35

1 Answer 1


Don't do that. Install curl in another folder and add it to the path before c:\windows\system32.

That way you will use the updated version without having to mess with the SO security.

  • This solution works great for the Windows cmd utility but be aware that Windows powershell will stubbornly ignore the PATH setting, whether your local curl install is referenced above it (or not) and continue to use the version installed in C:\windows\system32. I discovered this when >curl -V produced a prompt for a URL, rather than printing the version info.
    – Grindlay
    Aug 5, 2021 at 22:16
  • Hi @Grindlay, with powershell, you can see what command you are using with the get-command commandlet. Powershell respects the path the same way cmd does, but it's very often some script in your profile (and powershell has 4 profile locations, that can be changing your path... To be sure, type $Env:PATH in your console and you will see the PATH you are currently using... Just type $Env:PATH=<curl path>;$Env:Path and you will be fine...
    – Bigous
    Sep 16, 2021 at 20:40
  • Thanks for this. The entry 'D:\curl-7.78' (the version I want) appears twice in my PATH env variable, but so does 'C:\Windows\System32' . If I do: echo %PATH% in a CMD window, I get identical output to Powershell. Powershell is using the Windows cURL, CMD is using the version in 'D:\curl-7.78' I'm at a loss to explain this behaviour.
    – Grindlay
    Sep 19, 2021 at 10:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.