reddit / emacs

How to resolve certificate error in Emacs 25.1 (Windows)?

sreekumar_r · 2022-04-13 05:11
I am trying to get packages using **Straight.el** from my **.emacs** file. It uses **gnu-tls.cli** to fetch. Since, Emacs informed that **connection failed**, I ran the command from command prompt.The following is error message I getting. Thanks in advance. `$ ./gnutls-cli --x509cafile nil -p 443` [`raw.githubusercontent.com`](https://raw.githubusercontent.com) `Resolving '`[`raw.githubusercontent.com`](https://raw.githubusercontent.com)`'...` `Connecting to '`[`185.199.108.133:443`](https://185.199.108.133:443)`'...` `- Certificate type: X.509` `- Got a certificate list of 2 certificates.` `- Certificate[0] info:` `- subject \C=US,ST=California,L=San Francisco,O=GitHub, Inc.,CN=*.github.io', issuer \`C=US,O=DigiCert Inc,CN=DigiCert TLS RSA SHA256 2020 CA1', RSA key 2048 bits, signed using RSA-SHA256, activated \`2022-03-18 00:00:00 UTC', expires \`2023-03-21 23:59:59 UTC', SHA-1 fingerprint \`8f0e792471c5a7d2a7467630c13cb72a13b001b2'\`` `Public Key ID:` `340d31153bfb96af64ef26fcc00cc8da0d2071d8` `Public key's random art:` `+--[ RSA 2048]----+` `| .o. +oo. |` `| .oE + . |` `| . . o + |` `| . + o o |` `| S o |` `| o o = . |` `| . . ..X |` `| +o+. |` `| .*= |` `+-----------------+` ​ `- Certificate[1] info:` `- subject C=US,O=DigiCert Inc,CN=DigiCert TLS RSA SHA256 2020 CA1', issuer \`C=US,O=DigiCert Inc,[OU=www.digicert.com](https://OU=www.digicert.com),CN=DigiCert Global Root CA', RSA key 2048 bits, signed using RSA-SHA256, activated \`2021-04-14 00:00:00 UTC', expires \`2031-04-13 23:59:59 UTC', SHA-1 fingerprint \`1c58a3a8518e8759bf075b76b750d4f2df264fcd'\`` `- Status: The certificate is NOT trusted. The certificate issuer is unknown.` `*** PKI verification of server certificate failed...` `Error setting the x509 trust file` `*** Fatal error: Error in the certificate.` `*** Handshake has failed` `GnuTLS error: Error in the certificate.` ​
ieure · 2022-04-13 05:42
You need a newer version of gnuttls-cli, the one you have doesn't include the cert for the CA that issued GitHub's cert in its trusted roots.
sreekumar_r · 2022-04-13 06:08
My version of **gnutls-cli** is the latest (3.4.15) and gnutls library is **libgnutls-30.dll**. First I got it from Source Forge and then from GNU patches itself. Because I saw one answer telling the I have upgrade **libgnutls-28.dll** to libgnutls-30.dll. Is there any other new version?
gojirabsd · 2022-04-13 07:32
Emacs 25.1 or do you mean 28.1, that was released on April 4th, 2022. And gnutls 3.4.15 is not the latest version. There is already 3.6.16 and 3.7.4. What does "C-h v gnutls-trustfiles" show? Does one of the listed files exist? If you have installed the proper CA Root cert(s) modify gnutls-trustfiles. I only use Emacs on BSD and Linux. On Windows (10/11) maybe you should run Emacs in WSL2.
sreekumar_r · 2022-04-13 16:50
Yes, it is 25.1 only. And in gnutils website we can download both 3.6.16 and 3.7.4. But both are source code, and we have to build it. I use macs in my laptop, which runs Ubuntu 18. But in my work, I am forced to use Windows 10. Earlier it was working, but recently they changed the mother board and I am trying re install it.
00-11 · 2022-04-13 17:26
https://stackoverflow.com/q/71852172/729907
gojirabsd · 2022-04-13 19:39
Maybe try [https://ftp.gnu.org/gnu/emacs/windows/emacs-28/](https://ftp.gnu.org/gnu/emacs/windows/emacs-28/) e.g.: emacs-28.1.zip contains: ./bin/libgnutlsxx-28.dll ./bin/libgnutls-openssl-27.dll ./bin/libgnutls-30.dll ./share/info/emacs-gnutls.info ./share/emacs/28.1/lisp/net/gnutls.elc ./share/emacs/28.1/lisp/net/gnutls.el
sreekumar_r · 2022-04-14 13:23
Thanks. I will try and let you know. I am on holiday, and will be back in the office only next Monday.