tealdeer: Can't update cache: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

When trying to run tldr -u I get the following error:

Error: Could not update cache

Caused by: 0: error sending request for url (https://tldr.sh/assets/tldr.zip): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer 1: error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer 2: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

I tried to download the ZIP file mentioned in the URL with wget and curl which works flawlessly.

What could be the issue here?

Version: tealdeer 1.6.1 OS: Linux

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28

Most upvoted comments

@dbrgn It works perfectly! Thank you!

$ tldr --version
tealdeer 1.7.0

$ tldr --update
Successfully updated cache.

Oh, that is interesting. It’s also possible that version 1.6.1 of tealdeer (released 2 years ago) does not yet include some of the newer trust roots (C=US, O=Google Trust Services LLC, CN=GTS Root R4). The question is why it wouldn’t affect all users in that case… However, it’s possible that Cloudflare (where the files seem to be hosted) doesn’t use the same certificate for all requests.

@nick-s-b yesterday we released version 1.7.0 of tealdeer, with updated roots. The package is already available in the regular ArchLinux repositories. Could you update to that version and test if it works?

I read a bit of what appears to me as the relevant fish code and issues, I think it is unrelated. They are trying to listen on an interface and prefer ipv6, but sometimes fail to make the correct choice (see for example https://togithub.com/fish-shell/fish-shell/commit/47a9f99523d015768d8e21b9923e3e5acaf5a35c). We are only trying to connect to another device. In contrast to fish, we don’t decide whether to use ipv4 or ipv6 ourselves and let another library handle it.

From what I can tell, this is a bug in an underlying library with parsing the TLS certificate used by tldr.sh. It could of course be that ipv6 plays a subtle role in that bug, but I have no idea. It seems to me that this bug is happening on a higher level in the networking stack.

@nick-s-b That’s of course annoying. To get tealdeer to work for now, you can unzip the tldr.zip manually so that the directory structure is something like

/home/user
 .cache
  tealdeer
   tldr-pages
    pages
    pages.ar
    pages.bn
    ...

If you don’t care much about installing tealdeer from the Arch repositories vs. other methods, you could try installing with cargo or nix. In particular, using cargo with --no-default-features --features native-tls could work.

I think we can close this as it seems to be working fine now. @freijon are you still experiencing this? If not, please close with comment.