Skip to content

MSYS job failing with invalid SSL certificate error #14908

Open

Description

@xtqqczze

MSYS2's Cargo ships with a libgit2 build that cannot validate GitHub's TLS certificate in CI, causing Git dependency fetches to fail with:

the SSL certificate is invalid; class=Ssl
Console log from CI
+ make install DESTDIR=/tmp/w PREFIX=/tmp/usr MULTICALL=y COMPLETIONS=n MANPAGES=n LOCALES=n 'SKIP_UTILS=arch b2sum base32 base64 basename basenc cat comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold head hostname hostid join link ln ls md5sum mkdir mktemp more mv nl nproc numfmt od paste pathchk pr printenv printf ptx pwd readlink realpath rm rmdir seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split sum sync tac tail tee test touch tr true truncate tsort tty uname unexpand uniq unlink vdir wc whoami yes'
Detected OS = x86_64-pc-windows-gnu
    Updating git repository `[https://github.com/xtqqczze/djc-hostname.git`](https://github.com/xtqqczze/djc-hostname.git%60)
error: failed to load source for dependency `hostname`

Caused by:
  unable to update https://github.com/xtqqczze/djc-hostname.git?branch=target-aix#79b3e480

Caused by:
  failed to clone into: C:\Users\runneradmin\.cargo\git\db\djc-hostname-b43639a9f6b2c891

Caused by:
  revision 79b3e480f43a286cf493e45471e43546ab534f6b not found

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  the SSL certificate is invalid; class=Ssl (16)
cargo build --features openssl --features " " --profile=release --no-default-features
    Updating git repository `[https://github.com/xtqqczze/djc-hostname.git`](https://github.com/xtqqczze/djc-hostname.git%60)
error: failed to load source for dependency `hostname`

Caused by:
  unable to update https://github.com/xtqqczze/djc-hostname.git?branch=target-aix#79b3e480

Caused by:
  failed to fetch into: C:\Users\runneradmin\.cargo\git\db\djc-hostname-b43639a9f6b2c891

Caused by:
  revision 79b3e480f43a286cf493e45471e43546ab534f6b not found

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  the SSL certificate is invalid; class=Ssl (16)
make: *** [GNUmakefile:142: build-coreutils] Error 101

Activity

  1. xtqqczze commented on Sep 28, 2026

    @xtqqczze
    CollaboratorAuthor

    The git CLI does not have this problem because it uses the system certificate store. git is already available on PATH in all development and CI environments. Perhaps we can add the following to .cargo/config.toml:

    [net]
    git-fetch-with-cli = true
  2. xtqqczze commented on Sep 28, 2026

    @xtqqczze
    CollaboratorAuthor

    Better to set environment variable in CI workflow:

    CARGO_NET_GIT_FETCH_WITH_CLI: true
    
  3. xtqqczze commented on Sep 28, 2026

    @xtqqczze
    CollaboratorAuthor

    Experimenting with this approach in #14633.

  4. xtqqczze commented on Sep 28, 2026

    @xtqqczze
    CollaboratorAuthor

    Neither workaround is effective, we just see a different error:

    warning: spurious network error (3 tries remaining): No such file or directory (os error 2)
    warning: spurious network error (2 tries remaining): No such file or directory (os error 2)
    warning: spurious network error (1 try remaining): No such file or directory (os error 2)
  5. oech3 commented on Sep 29, 2026

    @oech3
    Contributor
  6. xtqqczze commented on Sep 29, 2026

    @xtqqczze
    CollaboratorAuthor

    I recall a previous Cargo issue on FreeBSD that was worked around by installing the ca_root_nss package. Perhaps a related workaround might be effective.

  7. xtqqczze commented on Sep 29, 2026

    @xtqqczze
    CollaboratorAuthor

    The equivalent MSYS2 package is ca-certificates, trying that in 6841378.

  8. self-assigned this
    on Sep 29, 2026
  9. xtqqczze commented on Sep 29, 2026

    @xtqqczze
    CollaboratorAuthor

    Neither workaround was effective, perhaps msys2/MSYS2-packages#2913 has a solution.

  10. lazka commented on Sep 30, 2026

    @lazka

    Is this about cygwin cargo, or mingw cargo? And is this a regression in MSYS2?

  11. oech3 commented on Sep 30, 2026

    @oech3
    Contributor

    MinGW UCRT64

  12. lazka commented on Sep 30, 2026

    @lazka

    The equivalent MSYS2 package is ca-certificates, trying that in 6841378.

    Then the package would be mingw-w64-ucrt-x86_64-ca-certificates instead (though I don't know if that is the solution)

  13. oech3 commented on Sep 30, 2026

    @oech3
    Contributor

    The package and git-fetch-with-cli is needed if and only if we pull crates from git source (crate.io is not a probrem). Right?

  14. xtqqczze commented on Sep 30, 2026

    @xtqqczze
    CollaboratorAuthor

    Yes, there seems to be an issue across multiple repositories when pulling crates from a Git source; it was also reported in the rustix repository. I’m not sure whether any of these workarounds are actually necessary, so I’m trying a few different approaches to see what works.

  15. 25 remaining items

  16. oech3 commented on Oct 1, 2026

    @oech3
    Contributor
  17. xtqqczze commented on Oct 1, 2026

    @xtqqczze
    CollaboratorAuthor

    The job is still failing:

    https://github.com/uutils/coreutils/actions/runs/36833541806/job/110275422164?pr=14633#step:7:39

    https://packages.msys2.org/base/libgit2 is still at 1.9.7-1.

    I'll give it a bit longer and check again tomorrow.

  18. ognevny commented on Oct 1, 2026

    @ognevny
    Contributor

    package updates don't appear in mirrors immediately, unfortunately:(

  19. xtqqczze commented on Oct 1, 2026

    @xtqqczze
    CollaboratorAuthor

    mingw-w64-ucrt-x86_64-libgit2-1.9.7-2 seems to have done the trick: https://github.com/uutils/coreutils/actions/runs/36844061917/job/110309839974?pr=14633#step:7:39

    @oech3 @lazka @ognevny Thank you for your assistance!

  20. SnoozeThis commented on Oct 2, 2026

    @SnoozeThis

    Resolved.

  21. xtqqczze commented on Oct 18, 2026

    @xtqqczze
    CollaboratorAuthor

    failing again with the same error, since at least 2026-10-15T22:56:03Z:

    https://github.com/uutils/coreutils/actions/runs/38818423996/job/116708782291

  22. lazka commented on Oct 19, 2026

    @lazka

    your "Update MSYS2 packages" step is failing, so that is another issue (you are doing a partial system update, which is not supported)

  23. xtqqczze commented on Oct 19, 2026

    @xtqqczze
    CollaboratorAuthor

    I see the step was reported as successful but actually failed:

    $ pacman -Sy --noconfirm --needed base-devel libopenssl make openssl-devel pkgconf rust mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-rust
    ...
    error: failed to synchronize all databases (unable to lock database)
    34173649 [main] pacman 2058 dofork: child -1 - forked process 2740 died unexpectedly, retry 0, exit code 0x1, errno 11
    error: could not fork a new process (Resource temporarily unavailable)
  24. xtqqczze commented on Oct 19, 2026

    @xtqqczze
    CollaboratorAuthor

    @lazka I tried adding set -e to the step, I don't understand why is reported as successful when it failed:

    https://github.com/uutils/coreutils/actions/runs/39319701135/job/118290258552?pr=15536#step:7:1

  25. oech3 commented on Oct 20, 2026

    @oech3
    Contributor

    Just replacing -Sy with -Syyu? Does it increate time needed for installing?

  26. xtqqczze commented on Oct 21, 2026

    @xtqqczze
    CollaboratorAuthor

    I think we must do update first as separate step:

          run: |
            pacman -Syu --noconfirm
          ...
          run: |
            pacman -S --noconfirm --needed \
          ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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