-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo can't download crates: SEC_E_ILLEGAL_MESSAGE
#12296
Comments
Copied from this #11344 (comment):
Also probably a duplicate of #12273, so I am going to close this. If you find anything interesting or different, please let us know. Thanks for the report anyway! |
Yes, this issue is a duplicate of #12273. But they both have nothing to do with #11344 because they have different error messages. #11344 is about "Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline." This issue (and #12273) is about "SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed)." So, you incorrectly closed two original issues due to your inattention. |
My bad! It was too careless of me. Repoened. This kind of bug happened a couple years ago (#9788). Was fixed with a libcurl version bump. I will try to look into its changelog a bit to see if we can find something suspicious. |
Perhaps the root cause of the error is the incorrect configuration of the crates.io servers, which is why some versions of Windows schannel cannot work with them. In the first post, I showed that Curl (the official distribution for Windows) normally downloads the required file. But it was with the default backend (openssl). Now I tested the curl with a non-standard backend (schannel) and got the same error:
So, if you still try to solve the problem from the side of Cargo, then two questions arise:
|
I've got some time looking into this, but had a hard time reproducing it. Could you share the full output of
Also, could you help bisect which version of cargo started suffering from this issue? That would help us narrow down the scope to investigate.
There were some discussions about it #8154 (comment). A native SSL backend could have access to Windows Credential Store, allowing for enterprise-wide certificates access. But yep, that could be a direction to fixing it.
I think it is possible. Someone needs to look into how to do that in https://github.com/alexcrichton/curl-rust. |
BTW, I found theses issue but not sure if it is related to the issue here.
|
i'm having the same issue. if someone has a workaround, please post it |
Do you know when this issue started to happen? That is, did downloading crates with Cargo on windows work at some point and then stop working? That could help us to narrow down configuration changes made to crates.io that could have caused this. Do you have any thoughts on the kind of incorrect configuration of the servers that could cause this? |
Have the same issue, on Archlinux |
Probably some guy or group of guys spilled smoothies on the prod server |
Or maybe ssl certificate need prolongate |
Еverything worked fine a couple of months ago. Of course, the real problem is in the Windows schannel. But this is basic infrastructure software already installed by millions of users. So all sites should adapt to the features of its work. And most sites do this successfully (Curl even with a schannel backend can easily download files from most sites). But there is an error with crates.io...
I suspect that it may be in the list of allowed TLS algorithms or something like that. |
This error occurred sometimes (perhaps on some servers?) with the previous version of Cargo. That's why I didn't start an issue about this error at the time. And some more information:
|
You get the same error message on Archlinux, including the part that says If your error message is different, and if you can reproduce the problem on Archlinux, could you please copy and paste the exact error message you're seeing please? |
Hi, I'm afraid that I have the same issue :_(
[35] SSL connect error (schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.) It's a random error, in the sense that if there are just a few libraries for to build, trying again, and again, the build can finish in success, but if there are many libraries involved (dependence of dependence, etc), most of the times will rise the error. I tried also with previous versions, but happens the same:
Turned back to cargo 1.70.0, and from command line the trace of a test project:
Output:
Then I downloaded curl for windows, with the same library version used by cargo (libcurl 8.0.1) for to try to get more information, but nothing is shown, just that curl for windows can download the files were cargo rise an error. https://curl.se/windows/dl-8.0.1_1/curl-8.0.1_1-win64-mingw.zip
-L Allow curl to follow any redirections
Output (Yesterday )
Can be seen a 21 seconds But I think this may be not significative about the issue we are talking about, because today I run again the test, there was not a time out connection and the downloads keep failing in cargo. What may be happening is both uses different configurations.
Output (Today):
|
Happens me exactly the same. As I've tried installing previous versions where I didn't had so many issues and now fails, I'm more inclined to think something changed in the servers, or in the protocols, until reach the critical mass where now almost always fails. That, in combination may be with some configuration in the library used by cargo, what passed more or less unperceived until now, due such configuration, or protocol, or number of connections, or something? I have not clue |
Maybe the problem is due to switching manifest format, because I faced with this error on cargo that worked several weeks ago (when the old manifest format was still used) and I did not update it from those times (but updated now just to check if issue is fixed or not. The logs below from updated cargo). My
Anyway, there is any workarounds for this? |
I tried to set environment variable Without quotes seems to just run
With quotes (double or single) nothing happened:
Is there a way to manually download all required crates and put them into cargo cache? Some flag in cargo that will show what it tries to download? By the way, why
|
Over this past saturday & sunday it has been working fine without any problems, but today the issue has come back again. |
A workaround until this is fixed: download crates manually. Unfortunately, you cannot know all packages at once (if you found the way, please share!), so you need repeat that steps for each missed package:
|
another workaround i found is to use the proxy with custom certificate, e.g. mitmproxy. it's a bit of hassle to setup, but you only have to do it once |
I'm almost certain that the The reason why the issues are appearing now is that we've started to serve traffic for crates ( As far as I can tell, this needs to be fixed on the user's machine. Microsoft provides a support article on how to Update to enable TLS 1.1 and TLS 1.2, which involves installing SP1 and adding a registry key. The article mentions an "easy fix" for the second step so that users don't need to edit the registry manually. A restart might be required. |
SEC_E_ILLEGAL_MESSAGE
@jdno I already have this update installed Secure Channel update, it does not solve this problem |
I also tried, same result (Thanks @jdno for having tried to find it). Lets identify it as kb2992611 Observing the client hello with wireshark, it adds 5 ciphers, but they are not within the ones that
Trying to find a method for to know the ciphers included without installing it, I've uncompressed with 7zip the windows6.1-kb********.msu, and again the .cab resultant, within a directory. With |
Yes, it works! The necessary update kb3140245 was already installed for me. But the registry keys specified in the article were not added. And after adding them, everything began to work.
|
@AlexPublicProfile try launching that curl call with the |
let's summarizePreviously the crates downloads were done by the When cargo is launched, firstly does a query to Cargo uses Currently cargo only uses schannel, which makes it dependent on the encryption libraries available in windows (TSL protocols + ciphers ). Windows 7 SP1 usersWhen cargo is addressed to
This happens in both cases because in addition to the TSL protocols, the encryption algorithms (Cipher Suits) available in windows 7 are also available (enabled) on the servers. [1] Update to enable TLS 1.1 and TLS 1.2 + Regedit edit, #12296 (comment) When cargo is addressed to
Mean while, workaroundsSomeones temporally mounted local proxies, #12296 (comment) , #12296 (comment) or manually downloaded #12296 (comment) In my case, I did a ping to I have to warn my workaround have a problem, when the host behind such IP changes, it stop working. And also have the danger of such IP being assigned to other host-client. I should create a script for checking and updating such host, or to install a DNS server local for making such IP overriding and check. Anyway, it is clear all this workarounds are a pain. How would it be solved ?If Cargo had the option for to enable OpenSSL within Meanwhile, if |
Here is an easier TLS mitm proxy in one line and does not need installation or anything else: proxify.exe -http-addr 127.0.0.1:18080 then add the proxify cert to windows cert manager: certutil -addstore -f -user "Root" "%USERPROFILE%\.config\proxify\cacert.pem" now before using Cargo do: set "CARGO_HTTP_CHECK_REVOKE=false"
set HTTPS_PROXY=127.0.0.1:18080
set HTTP_PROXY=127.0.0.1:18080 that's all
|
this is also affecting me on windows 8.1. rust is effectively unusable for me right now. |
Yes, I was wrong because of an unlikely coincidence. I had the following sequence of steps:
And from this it was logical to suggest that the specified method solves the problem. But in fact, the load balancer changed the servers for me at that very moment. Now the situation looks like this (and according to nokotto's analysis, no Windows patches will change it):
|
As a very temporary solution: adding a cname record to the dns on the router, redirecting static.crates.io to cloudfront-static.crates.io. |
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
Thanks to badrelmers. rust-lang/cargo#12296 (comment)
The Proxify solution works for me. Thanks, @badrelmers! I have implemented it on AppVeyor CI. Below are the changes to my index 7e630d3..7c25286 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -8,9 +8,16 @@ cache:
- '$(CARGO_PATH) -> appveyor.yml, Cargo.lock, Cargo.toml'
install:
+ - cmd: appveyor-retry appveyor DownloadFile https://github.com/projectdiscovery/proxify/releases/download/v0.0.9/proxify_0.0.9_windows_386.zip -FileName proxify.zip
+ - cmd: unzip -n proxify.zip
+ - ps: Start-Process -FilePath proxify.exe -ArgumentList "-config","proxify-config","-http-addr","127.0.0.1:18080"
+ - cmd: timeout /t 5
+ - ps: Import-Certificate -FilePath "proxify-config\cacert.pem" -CertStoreLocation Cert:\LocalMachine\Root
- cmd: appveyor-retry appveyor DownloadFile https://win.rustup.rs -FileName rustup-init.exe
- - cmd: rustup-init.exe --default-toolchain %RUST_VERSION% -y
+ - cmd: set HTTP_PROXY=127.0.0.1:18080
+ - cmd: set HTTPS_PROXY=127.0.0.1:18080
- cmd: set PATH=%CARGO_PATH%\bin;%PATH%
+ - cmd: rustup-init.exe --default-toolchain %RUST_VERSION% -y
build_script:
- cmd: cargo build Sorry about the mention noise above. I didn't remove the link to the issue from the commit message when debugging CI. |
Hi folks, Sorry for the long wait. I've been working with our contacts at Fastly and they've enabled a more permissive TLS configuration with more cipher suites for us. I've redeployed our services and the new suites are now live. Let me know if this fixes the issue with cargo and crates.io for you. |
It's really all right now:
|
I also confirm it fixed it , thanks very much! ( I checked the Cargo's downloads went through Fastly ) |
Hi folks, The new configuration has been live for the past 10 days and so far we've seen no issues. I'm going to close the GitHub issue, but feel free to report back if you get the above error on a patched Windows version again. Thanks 👋 |
For anyone having problems behind a windows firewall: there is two cargo.exe.. one inside .cargo and one inside .rustup. Make sure to allow the other. |
facing same issue on mac any idea anyone? |
Thank you ! This reference helped to solve this issue on Windows Server 2019 ;) <3 |
Problem
But
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: