Skip to content

rustup refuses server certificate on openSUSE Tumbleweed #2878

@frgomes

Description

@frgomes

Problem

rustup refuses the server certificate on openSUSE Tumbleweed.

  • firewall is disabled on openSUSE.
  • no proxy configuration or any other MITM software.
  • curl and openssl accept the server certificate as it should be.
  • rustup works fine on a Debian 11 box connected to the same router.
  • rustup works fine on a openSUSE instance running on WSL2.

Steps

$ uname -a
Linux mars 5.14.11-2-default #1 SMP Sun Oct 10 08:34:34 UTC 2021 (834dddd) x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20211019"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20211019"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20211019"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"

$ ./rustup -V
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.53.0 (53cb7b09b 2021-06-17)`
(j11s300) [2021-10-22 00:50:24] rgomes@mars:~/.cargo/bin$ ./rustup -v check
verbose: read metadata version: '12'
verbose: creating temp file: /home/rgomes/.rustup/tmp/5zy78gtql715nkgz_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/rgomes/.rustup/tmp/5zy78gtql715nkgz_file'

Caused by:
    0: failed to make network request
    1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.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:

curl and openssl accept the server certifcate on this very same machine and terminal session:

$ curl -s https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
2f57b4a3b6b3463387774cc16bec64167c5d16e94fa1f4de7524c46194a38f6b  channel-rust-stable.toml

$ echo | openssl s_client -servername rust-lang.org -connect static.rust-lang.org:443 2>/dev/null | openssl x509 -noout -issuer -subject -dates
issuer=C = US, O = Amazon, OU = Server CA 1B, CN = Amazon
subject=CN = rust-lang.org
notBefore=Jul 24 00:00:00 2021 GMT
notAfter=Aug 22 23:59:59 2022 GMT

I would expect a successful output, like it happens on my Debian 11 box:

$ ./rustup -v check
verbose: read metadata version: '12'
verbose: creating temp file: /home/rgomes/.rustup/tmp/yix3x9ddke03zoxs_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
verbose: deleted temp file: /home/rgomes/.rustup/tmp/yix3x9ddke03zoxs_file
stable-x86_64-unknown-linux-gnu - Up to date : 1.56.0 (09c42c458 2021-10-18)
rustup - Up to date : 1.24.3

Possible Solution(s)

Nothing listed below produced any benefit:

  1. I've reinstalled all packages on this openSUSE box, and performed a dist-upgrade;
  2. I've removed all 32bit packages;
  3. I've installed packages which could possibly contribute to mitigate the problem, namely:
$ zypper se -i cert
Loading repository data...
Reading installed packages...

S  | Name                    | Summary                                               | Type
---+-------------------------+-------------------------------------------------------+--------
i+ | ca-certificates         | Utilities for system wide CA certificate installation | package
i+ | ca-certificates-cacert  | CAcert root certificates                              | package
i+ | ca-certificates-mozilla | CA certificates for OpenSSL                           | package
i+ | mozilla-nss-certs       | CA certificates for NSS                               | package
i+ | python38-certifi        | Python package for providing Mozilla's CA Bundle      | package
  1. I've updated ca-certs:
$ sudo update-ca-certificates -f -v
running /usr/lib/ca-certificates/update.d/50java.run ..
creating ///var/lib/ca-certificates/java-cacerts ...
running /usr/lib/ca-certificates/update.d/70openssl.run ..
creating ///var/lib/ca-certificates/openssl ...
running /usr/lib/ca-certificates/update.d/80etc_ssl.run ..
running /usr/lib/ca-certificates/update.d/99certbundle.run ..
creating ///var/lib/ca-certificates/ca-bundle.pem ...

i've found this ///var/lib/ca-certificates above suspicious.

Notes

Output of rustup --version:

rustup 1.24.3 (ce5817a94 2021-05-31)

Output of rustup show:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/rgomes/.rustup

no active toolchain

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions