-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Peer certificate cannot be authenticated with given CA certificates (SSL certificate problem: certificate has expired) #11670
Comments
I believe this is likely due to the age of the system you are running on ( |
Both my certificates (Amazon Root CA 1 and ISRG Root X1) are valid. I can't access https://static.crates.io/ cause I got access denied, I think it Is related to this issue. |
The "AccessDenied" message when visiting https://static.crates.io/ via a browser is normal (the root doesn't have anything to serve). Perhaps you can post the output of |
Thanks for the info about certificates. I finally got it working by running |
Go ahead to close this issue in order to make the issue backlog less scary. Thank you for the help of investigation! |
Sorry to comment on a closed issue, but I've noticed the same issue for the last few weeks - on some crates (not all), and as @igortavtib mentioned, if you do Sharing the output of the
Platform details:
I can provide more details if needed, and if it helps! |
@timmyjose Thanks for posting the details. One explanation for the randomness is that crates.io balances between two different CDNs (fastly and cloudfront), and it may be swapping between the two. Can you check that you have a root certificate on your system? Open the app "Keychain Access" and search for "ISRG Root X1". You should have a certificate listed there, and its expiration should be June 4, 2035. |
Ah, yes. That makes sense indeed.
Checked and confirmed! The certificate does exist and has an expiry date exactly as you mentioned: Thanks for having a look at it, @ehuss, by the way. If you need more information from my side, please do let me know. |
Just to add an observation from my side - yesterday I uninstalled Rust and reinstalled it again, and faced pretty much the same issue (the issue had been masked presumably because my existing projects all used crates which had been already downloaded previously) - tried it at periodic intervals till it actually worked (again, presumably because the load balancer kicked in and redirected the calls elsewhere). A secondary observation - if I manually invoke the link (as mentioned in the error message for a specific crate), the browser can download the crate. So I was wondering how much that figures into the equation? I tried poking around at the certificates the browser uses, but seems to be pretty much the same - Amazon CA ultimately. Another thing I tried is updating my curl version, but that did not help either (since another thread mentioned that Do you folks think that this issue should be re-opened? @ehuss @weihanglo |
Yea, seems reasonable to reopen. I don't really have any ideas yet on what might be wrong. WRT using a browser, browsers have their own set of certificates. Cargo uses the ones managed by your OS on macOS. When reporting, it is very important to include the output of If you want to try to investigate the certificates against your system, I would recommend checking the certificates for: |
@timmyjose This line in the curl output stands out to me:
This almost sounds like an old issue with OpenSSL that was reported for Ubuntu (see StackOverflow and Ubuntu bug). The last message in the bug report is from 2014 and mentions OpenSSL 1.0.1, which was afaik the last version in macOS 10.13 before the switch to LibreSSL. Can you post the versions of curl and openssl on your machine? curl --version
openssl version And the following command can be useful for testing. It connects to Fastly using OpenSSL and prints the certificate chain: openssl s_client -connect fastly-static.crates.io:443 -servername static.crates.io -showcerts </dev/null |
Hey @jdno, thanks for the suggestions and the SO link (will check it out). In the meantime,
(the version of libcurl bundled with
If I run this command, I do get a bunch of certificates (the whole certificate chain, presumably).
(I've removed the actual text of the certificates in the output above). |
I have figured out how to reproduce this locally. I'm pretty certain this is because the version of LibreSSL on older versions of macOS is running into the issue where it prefers untrusted certificate chains. From what I understand, the Let's Encrypt certificate is cross-signed with their old (expired) DST Root CA X3 certificate to deal with some bug in older versions of Android. notes: https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ @jdno Is there any way to not have that cross-signature? AFAIK, it is not feasible to update the system libcurl or libressl. Are there any known workarounds if you are on an older version of OpenSSL? |
Yeah, looking at the version numbers only
🤦♂️ My bad, totally misinterpreted the console output and the certificate details in the browser. Let me check with our contact at Fastly what we can do. |
Hey @ehuss @jdno, thanks for looking into the issue. Appreciate it. If there's anything I can do from my side, please do let me know. I'm not familiar with Cargo internals, but in case you need any data, or need me to try out updating/installing some components, I could try it out. (I tried upgrading LibreSSL and making it the default openssl client, but that didn't help - how does Cargo pick up the versions specified in the |
Same exact issue on my side using macOS 10.14.6. ISRG Root X1 also expires June 4th 2035 and Amazon Root CA 1 January 17th 2038. Cargo switches between working and not working periodically. If there is anything I can do to gather more data please let me know curl --version
openssl version
cargo -vV
|
Same issue and very same setup as @jorundev (Mac OS 10.14.6 with LibreSSL 2.6.5). |
Apologies for the inconvenience, folks. Please know that I'm working on this. I did some more research and testing yesterday, and eventually found this post by a member of Let's Encrypt's staff that confirms @ehuss suspicion that the issue has to do with the cross-signed root certificate. Quickly summarized, OpenSSL < 1.1 and LibreSSL < 3.2 will just not work with Let's Encrypt's default chain. I'm now in the process of switching our staging environment over to a certificate provided by GlobalSign. If we can confirm that this resolves the issue with older OpenSSL versions, we'll roll it out to production as well. |
Sorry for the wait, everyone! It took a few days to confirm the fix on staging and test the rollout process to production. Our Fastly service for This has resolved the above issues on macOS 10.13 (or other systems that still rely on OpenSSL < 1.1) in my test environment. If you continue to experience issues, please let me know so that we can investigate. |
Thank you so much for the fix, @jdno. Also thanks to @ehuss! Really appreciate it. I just tested it now (had to wait a bit till the GlobalSign one got picked):
and I was able to fetch and build with no problems:
Thank you! |
After running the new certificates in production for four weeks, I'm gonna close this issue. If anyone runs into this or a similar issue in the future, feel free to create a new issue. |
Problem
I was trying to run my bevy learning project when I get this error after runing
cargo run
:Steps
cargo new
cargo run
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: