Klimenty
Klimenty5mo ago

BadCertificate error using deno 1.25.4

Hello, I am facing an error in my deno + node js app. I cannot figure out how why it is happening. The error is too vague for me. I'm simply trying to install the dependencies. My environment (using Ubuntu 22.04.4 LTS): kkaravaev@kkaravaev1:~$ node -v v16.20.2 kkaravaev@kkaravaev1:~$ deno --version deno 1.25.4 (release, x86_64-unknown-linux-gnu) v8 10.7.193.3 typescript 4.7.4 kkaravaev@kkaravaev1:~$ npm -v 8.19.4 kkaravaev@kkaravaev1:~$ Complete error message: Sending fatal alert BadCertificate Sending fatal alert BadCertificate error: error sending request for url (https://deno.land/x/cliffy@v0.20.1/command/mod.ts): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer at file:///home/kkaravaev/2222.kpmi-invest-legacy-web/node_modules/eftr-tools/_cli/_deps/cliffy/cliffy.ts:2:15 npm ERR! code 1 npm ERR! path /home/kkaravaev/2222.kpmi-invest-legacy-web npm ERR! command failed npm ERR! command sh -c -- ./ci_post_install.sh && patch-package npm ERR! A complete log of this run can be found in: npm ERR! /home/kkaravaev/.npm/_logs/2024-06-24T13_57_52_382Z-debug-0.lo
5 Replies
Klimenty
Klimenty5mo ago
Is there a way to disable whatever checks Deno is doing so that I can avoid that error?
pyrote
pyrote5mo ago
Have you ran, sudo apt-get upgrade ca-certificates The UnknownIssuer message makes it seem like Deno can't find a valid certificate and you may not have the latest one for Let's Encrypt. Can you upgrade your version of Deno? That version is a few years old.
Klimenty
Klimenty5mo ago
I cannot upgrade Deno the project requires this version for some reason. Updating didn't help Does Deno use Let's Encrypt?
pyrote
pyrote5mo ago
Yes deno.land is using a Let's Encrypt certificate. I installed 1.25.4 on a Ubuntu 22.04.4 LTS machine and can load that cliffy module. Just running a file with,
import * as cliffy from "https://deno.land/x/cliffy@v0.20.1/command/mod.ts"
import * as cliffy from "https://deno.land/x/cliffy@v0.20.1/command/mod.ts"
downloads the module correctly. Try running that as a test and see if it downloads the module in your environment.
Klimenty
Klimenty4mo ago
I fixed it by adding Let's Encrypt and some other Root CA certificates to my system. Not sure which one fixed it for me but I am now able to run the Deno script without any errors. Thank you for your guidance @pyrote