Rank 2: Process
yeah it works
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
yeah it works
Rank 2: Process
I will review cors (maybe that is the error)
Admin
And you said you tried using the LAN IP of your machine?
Admin
And are you disabling the SSL verification?
Rank 2: Process
yeah I tried to use the lan ip also
Rank 2: Process
no i didn't i will review in axios docs
Admin
Did you test localhost using axios?
Rank 2: Process
yeah, but localhost points to the container itself
Admin
And it was https without any extra SSL bypass?
Rank 2: Process
yeah
Admin
That's kind of surprising....
What OS do you have?
Rank 2: Process
now the error says "self-signed certificate"
Rank 2: Process
windows 11 and WSL ubuntu 20.04
Admin
Try to set up ignore SSL verification
Admin
So that API you have...is that running in a docker container?
Rank 2: Process
No, the api is running in windows, and I'm trying to call it from an appwrite function (container)
Rank 2: Process
sorry i didn't explain it well
Rank 2: Process
It is working now, I disabled SSL verification from axios using:
httpsAgent: new https.Agent({
rejectUnauthorized: false,
}),
Rank 2: Process
But It only works with the LAN ip
Rank 2: Process
It doesnt work with the bridge 172.17.0.1
Admin
Yes that makes sense because WSL is like a virtual machine inside windows
Admin
That bridge would be a bridge to WSL, not windows
Rank 2: Process
Yes, I tried to call the endpoint with curl from WSL, it only works with lan ip not localhost
Admin
[SOLVED] call api from a function
Rank 2: Process
Thank you so much @Steven