Back

[SOLVED] AppwriteException [Error]: self-signed certificate local dev

  • 0
  • Functions
Osman
6 Oct, 2023, 14:30

Wait, as a project variable or in the .env file?

TL;DR
Title: [SOLVED] Issue with self-signed certificate in local development Solution: The user had two client instances in their code, one using an API key and another using a user JWT. In the second client instance, there was a check that was causing the error. The user apologized for the confusion and thanked the community for their help. Additionally, the user had a question about the Node.js version being used. The issue was resolved, and everything is now running smoothly.
Drake
6 Oct, 2023, 14:31

Sorry I meant function variable

Osman
6 Oct, 2023, 14:34

Yea, same error still unfortunately

Drake
6 Oct, 2023, 18:21

and you deployed the env var change? can you log the env var and type of the env var to check?

Osman
6 Oct, 2023, 18:33

Wierd, adding new function variables through the console isn't working.. πŸ˜…

Drake
6 Oct, 2023, 18:34

what do you mean?

Osman
6 Oct, 2023, 18:40

Disregard that, think it was just acting up. However, nothing appears when i log process.env.NODE_TLS_REJECT_UNAUTHORIZED

Drake
6 Oct, 2023, 18:45

sounds like the env var isn't set. did you redeploy after adding the env var?

Osman
6 Oct, 2023, 18:46

yea i did, tried creating another function variable and it works just fine

Osman
6 Oct, 2023, 18:56

When i set a function variable to be 1, i get this: Var: 1, Var type: string when i set it to be 0, i get this: Var: , Var type: string 🧐

Drake
6 Oct, 2023, 19:01

Oh lol ....

Osman
6 Oct, 2023, 19:01

Im mildly confused lol

Drake
6 Oct, 2023, 19:02

We do checks for things and it could be that we filtered it out because we thought it was nothing

Drake
6 Oct, 2023, 19:03

In your code, can you add process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";

Osman
6 Oct, 2023, 19:06

That works πŸ™‚

Osman
6 Oct, 2023, 19:09

Everything running as it should

D5
6 Oct, 2023, 19:31

[SOLVED] AppwriteException [Error]: self-signed certificate local dev

Osman
6 Oct, 2023, 19:44

Should i create an issue or?

D5
6 Oct, 2023, 20:03

Hmm yes

Drake
6 Oct, 2023, 20:08

it's okay, i've already created one: https://github.com/appwrite/appwrite/issues/6832

Osman
6 Oct, 2023, 20:31

Aight, appreciate the help steven <:appwritefire:823999000330895380>

Drake
6 Oct, 2023, 22:46

question...what node runtime were you using?

Drake
6 Oct, 2023, 22:47

or what version of node were you running where you got the error?

Osman
7 Oct, 2023, 06:23

i have node 18.18.0 installed locally, and logging process.version gives 18.0.0

Osman
7 Oct, 2023, 07:40

I found the issue. I have 2 client instances in the function. The primary using an API key to act as the server and then another temporary client using the user JWT, in order to verify the user upon request. In the second one i was doing a check whether to setSelfSigned or not, which was failing. I apologize for the confusion, and again, thank you for the help regardless

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more