Description
Problem
I'm on an experimental fresh build of linuxfromscratch using openssl-3 with llvm-13.0 and rust-1.56.0 (specifically, this system has never had openssl-1.1.1 installed). When I try to build cbindgen, it reports
Updating crates.io index
Downloading crates ...
error: failed to download from
https://crates.io/api/v1/crates/ansi_term/0.11.0/download
Caused by:
[60] SSL peer certificate or SSH remote key was not OK (SSL
certificate problem: unable to get local issuer certificate)
Other packages (e.g. librsvg) seem to download crates without problems.
I had expected a successful download of all the required crates. I went back to a slightly older system on the same machine using openssl-1.1.1, wiped out ~/.cargo and succeeded in downloading the crates and compiling cbindgen.
Came back to the experimental system, again wiped out ~/.cargo, then ran strace to try to work out if I was missing a certificate (unlikely) and was surprised by what I eventually saw.
First it looks for certs and finds them in /etc/pki/tls/ca-bundle.crt, and it also correctly uses /etc/ssl. Then it looks at the builder's .cargo/registry (empty) and starts downloading registry items including ansi_term. OK so far.
Then it reads the builder's (empty) .cargo/.package-cache and downloads crates. But after getting several of them (ansi_term has not been mentioned among these downloads) it eventually connects to another host:
connect(7, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("99.86.119.114")}, 16) = -1
EINPROGRESS (Operation now in progress)
and after a little while it reports
poll([{fd=7, events=POLLPRI|POLLOUT|POLLWRNORM}], 1, 0) = 0 (Timeout)
After that it cleans up and reports it could not validate the certificate or remote key.
That address is an Amazon cloud host. I do not understand why that is being accessed, and I suspect it happened to be offline or else not offering the sought service.
Something similar (but without strace showing an excursion to Amazon) was reported in kisslinux/repo#339 which suggested that the cert details were somehow being lost when using openssl-3, and that using envvars to point to them fixed it. Did not fix it for me.
This appears to not be true for everyone using openssl-3 (one of my colleagues was able to build cbindgen), but for me it is a showstopper.
Steps
untar cbindgen-0.20.0
cd into cbindgen-0.20.0
run 'cargo build'
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.56.0
release: 1.56.0