You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustup (and cargo) unable to get local issuer certificate #2924
Hey. I'm facing a similar problem as #2878:
When trying to install rust using the recommended shell command from herecurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh I face the same error saying "unable to get local issuer certificate".
I tried to install rustup via my distributions package then, and this worked pretty well. Now, trying to use cargo brings me to the exact same error "unable to get local issuer certificate".
I'm happy to help as good as I can. Rust for me is just a hobby beside my job so I'll be happy trying to get it fixed since I don't have any dependencies that it has to work again soon. Shoot me with any debugging info I'm happy to provide anything.
The issue also appearing in cargo when installing via distro package manager (zypper), I guess it's not really a rustup or cargo problem, but more of a os-certificate-store vs rust-server-certificate problem. I'm pretty sure this has something to do with the openSuSE Tumbleweed and will ask in their discord as soon as I can, but I just wanted to report that the error happened again because @kinnison asked do to so in the other issue. If I find an answer in discord I will provide it here of course.
Steps
Install openSUSE Tumbleweed
Run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
changed the title [-]rustup (and cargo) unable to local issuer certificate[/-][+]rustup (and cargo) unable to get local issuer certificate[/+]on Dec 9, 2021
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
warning: Updating existing toolchain, profile choice will be ignored
verbose: updating existing install for 'nightly-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/ts/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/ts/.rustup/tmp/7x7qjlxh83ms34_5_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256'
verbose: downloading with reqwest
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/ts/.rustup/tmp/7x7qjlxh83ms34_5_file'
Caused by:
0: failed to make network request
1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256): error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
2: error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
3: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
4: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915:
Update from my side (I will also close the ticket).
I involved the openSuSE support and found out there was a second openssl installation in /usr/local/bin instead of /usr/bin which was used.
I still don't know where that openssl version is coming from, I checked my package manager and it doesn't seem to be connected to any rpm/zypper package. It works for me now. Steps for me to fix it:
# mv /usr/local/bin/openssl /root/backup/openssl/bin/openssl
# mv /usr/local/ssl /root/backup/openssl/
# update-ca-certificates
I don't know if the last step is necessary, but after it I had everything working.
Had the same issue, I installed an old version of OpenSSL to get the Linux port of Garry's Mod working, but apparently that broke Rustup. I guess I'll have to stick it in a path that isn't automatically picked up. Facepunch/garrysmod-issues#5056 (comment)
Update from my side (I will also close the ticket).
I involved the openSuSE support and found out there was a second openssl installation in /usr/local/bin instead of /usr/bin which was used. I still don't know where that openssl version is coming from, I checked my package manager and it doesn't seem to be connected to any rpm/zypper package. It works for me now. Steps for me to fix it:
# mv /usr/local/bin/openssl /root/backup/openssl/bin/openssl
# mv /usr/local/ssl /root/backup/openssl/
# update-ca-certificates
I don't know if the last step is necessary, but after it I had everything working.
moving/usr/local/ssl to /root/backup/openssl/ worked for me.
Did you end up deleting the backup folder, /root/backup/openssl/, afterwards?
I ended up here because i had a matching error message as in these comments but my issue was that I had set SSL_CERT_FILE for testing purposes and forgot to unset it after the test. Worth checking SSL_CERT_FILE.
It seems i have roughly the same error. But i'm at home / in local, without any proxy + certificates are up to date on my (archlinux) system.
In fact i try to install an AUR package (MDQ), locally compiling the rust source code ... and it's failing with that same kind of rustup error.
If i launch it manually in debut (outside AUR installation through YAY), then i see :
debug: read metadata version: '12'
debug: looking for installed toolchain 'stable-x86_64-unknown-linux-gnu'
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
debug: installing toolchain 'stable-x86_64-unknown-linux-gnu'
debug: toolchain directory: '/home/users/sergio/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
debug: creating temp file: /home/users/sergio/.rustup/tmp/87zhxjjq5nx7ptne_file
debug: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
debug: downloading with reqwest
error: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) } }) })
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/users/sergio/.rustup/tmp/87zhxjjq5nx7ptne_file'
Caused by:
0: error downloading file
1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256)
2: client error (Connect)
3: invalid peer certificate: UnknownIssuer
(this is nearly the only error i found about that "UnknownIssuer")
@SR-G I have seen a similar issue in our CI (#3810) and it has been resolved exactly by installing the CA certs. It is also possible that your browser uses a different CA cert configuration than your CLI as discussed above... I'm not quite sure. So many local states are involved here, it seems to me.
Mhh ok but still not sure how to solve that ...
On ARCH i've just installed the "ca-certificates-mozilla-3.111-1" AUR package (which seems to be similar to the "ca_root_nss" package discussed in #3810), but still the same error ...
Also, from the same CLI than where rustup is failing, a CURL or WGET (against the URL used by rustup) is perfectly working ...
wget "https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256"
--2025-05-08 11:56:08-- https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving static.rust-lang.org (static.rust-lang.org)... 151.101.130.137, 151.101.2.137, 151.101.194.137, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|151.101.130.137|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 91 [binary/octet-stream]
Saving to: ‘channel-rust-stable.toml.sha256’
channel-rust-stable.toml.sha256 100%[========================================================================================================================================>] 91 --.-KB/s in 0s
2025-05-08 11:56:08 (25.1 MB/s) - ‘channel-rust-stable.toml.sha256’ saved [91/91]
It's like rustup was not using that /etc/ssl/certs path on ARCHLINUX, maybe ?
"rustup" is installed on my system with AUR package, so should be up-to-date (i would say) :
rustup --version
rustup 1.28.2 (2025-05-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: No `rustc` is currently active
whereis rustup
rustup: /usr/bin/rustup /usr/lib/rustup
Fixed: SSL certificate error caused by Conda/Miniforge environment.
In my case, running the recommended command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh failed with the "unable to get local issuer certificate" error.
Root Cause: An active Conda/Miniforge environment was interfering with the system's OpenSSL path, preventing curl from finding the host's CA certificates.
Solution: > Running conda deactivate (to exit the environment) or explicitly setting the certificate path solved the issue: export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
After doing this, the installation worked perfectly.
Activity
[-]rustup (and cargo) unable to local issuer certificate[/-][+]rustup (and cargo) unable to get local issuer certificate[/+]tks09 commentedon Dec 9, 2021
Downloaded the install script and run with -v:
tks09 commentedon Dec 9, 2021
running cargo with strace I found out that cargo tries to search certs in /usr/local/ssl/certs
stat("/usr/local/ssl/certs/244b5494.0", 0x7ffcd8565748) = -1 ENOENTa listing of that directory returns it's empty:
In general, if I search for a file called
ca-certificates.crton my system, I don't find anything except of /var/lib/flatpak and /var/lib/dockertks09 commentedon Dec 15, 2021
openssl s_client -connect static.rust-lang.org:443 -servername static.rust-lang.org -showcerts < /dev/nullIt seems that the SSL connection to remote does not work because of missing peer and client certificates
tks09 commentedon Dec 16, 2021
Update from my side (I will also close the ticket).
I involved the openSuSE support and found out there was a second openssl installation in
/usr/local/bininstead of/usr/binwhich was used.I still don't know where that openssl version is coming from, I checked my package manager and it doesn't seem to be connected to any rpm/zypper package. It works for me now. Steps for me to fix it:
kinnison commentedon Dec 16, 2021
Thank you @tsmt09 for letting us know what the solution was - hopefully this will help others who encounter similar looking issues.
chinoto commentedon Jan 5, 2022
Had the same issue, I installed an old version of OpenSSL to get the Linux port of Garry's Mod working, but apparently that broke Rustup. I guess I'll have to stick it in a path that isn't automatically picked up.
Facepunch/garrysmod-issues#5056 (comment)
surferwat commentedon Apr 29, 2022
moving/usr/local/ssl to /root/backup/openssl/ worked for me.
Did you end up deleting the backup folder, /root/backup/openssl/, afterwards?
philjb commentedon Jan 29, 2025
I ended up here because i had a matching error message as in these comments but my issue was that I had set
SSL_CERT_FILEfor testing purposes and forgot to unset it after the test. Worth checking SSL_CERT_FILE.SR-G commentedon May 7, 2025
It seems i have roughly the same error. But i'm at home / in local, without any proxy + certificates are up to date on my (archlinux) system.
In fact i try to install an AUR package (MDQ), locally compiling the rust source code ... and it's failing with that same kind of rustup error.
If i launch it manually in debut (outside AUR installation through YAY), then i see :
Again, my certificates (ca-certificates, etc.) are 100% installed ...
Also i can flawlessly download that file (= "https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256") from any browser
Any ideas ?
(this is nearly the only error i found about that "UnknownIssuer")
rami3l commentedon May 8, 2025
@SR-G I have seen a similar issue in our CI (#3810) and it has been resolved exactly by installing the CA certs. It is also possible that your browser uses a different CA cert configuration than your CLI as discussed above... I'm not quite sure. So many local states are involved here, it seems to me.
cc @djc
SR-G commentedon May 8, 2025
Mhh ok but still not sure how to solve that ...
On ARCH i've just installed the "ca-certificates-mozilla-3.111-1" AUR package (which seems to be similar to the "ca_root_nss" package discussed in #3810), but still the same error ...
Also, from the same CLI than where rustup is failing, a CURL or WGET (against the URL used by rustup) is perfectly working ...
It's like rustup was not using that /etc/ssl/certs path on ARCHLINUX, maybe ?
djc commentedon May 8, 2025
Which version of rustup are you using? Can you run it with
RUSTUP_LOG=trace?Also please just file a new issue instead of reusing this closed one.
SR-G commentedon May 8, 2025
"rustup" is installed on my system with AUR package, so should be up-to-date (i would say) :
(second one is of course a folder)
Ok opening a new issue. Done : #4325
Torth-Sun commentedon Jan 26, 2026
Fixed: SSL certificate error caused by Conda/Miniforge environment.
In my case, running the recommended command
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shfailed with the "unable to get local issuer certificate" error.Root Cause: An active Conda/Miniforge environment was interfering with the system's OpenSSL path, preventing
curlfrom finding the host's CA certificates.Solution: > Running
conda deactivate(to exit the environment) or explicitly setting the certificate path solved the issue:export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crtAfter doing this, the installation worked perfectly.