Skip to content

also set $CARGO_HTTP_CAINFO on RHEL systems #290

Description

@bedroge

While debugging a Rust problem, I just ran into this error on a Rocky 8 node:

$ cargo add bitvec
    Updating crates.io index
error: download of config.json failed

Caused by:
  failed to download from `https://index.crates.io/config.json`

Caused by:
  [77] Problem with the SSL CA cert (path? access rights?) (error setting certificate file: /etc/ssl/certs/ca-certificates.crt)

We already set a bunch of variables on RHEL-based systems, see:
https://github.com/EESSI/software-layer-scripts/blob/main/init/modules/EESSI/2023.06.lua#L286

But for Cargo we also need to set $CARGO_HTTP_CAINFO to the same path; that solved the issue for me:

$ export CARGO_HTTP_CAINFO=/etc/pki/tls/certs/ca-bundle.crt
$ cargo add bitvec
    Updating crates.io index
      Adding bitvec v1.1.1 to dependencies
             Features:
             + alloc
             + atomic
             + std
             - serde
             - testing
    Updating crates.io index
     Locking 5 packages to latest Rust 1.91.1 compatible versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions