cargo: Useless error when ca-certificates are missing

I was trying to cargo build something in a newly created chroot and got the following output:

    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): curl error: 
; class=Net (12)
warning: spurious network error (1 tries remaining): curl error: 
; class=Net (12)
error: failed to fetch `https://github.com/rust-lang/crates.io-index`           

Caused by:
  curl error: 
; class=Net (12)

Even with colors, this is not a great error message. Strace hinted me that /etc/ssl/certs/ca-certificates.crt was missing, and sure enough, it worked after installing the ca-certificates package. But that wasn’t thanks to cargo’s error message.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

I am on Windows 7, and @retep998 pointed me to this Windows update’s docs. I can confirm that applying the reg key mentioned there fixed it for me immediately.

New-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp' -Name DefaultSecureProtocols -PropertyType DWORD -Value 0x00000800

Might this be due to https://github.com/blog/2507-weak-cryptographic-standards-removed ?

If so, this might have just broken all Rust users on Windows 7…