Error: unable to verify leaf signature
Unanswered
Citrine Wagtail posted this in #help-forum
Citrine WagtailOP
so i have an api in the client side which is used to fetch the subscriptions but every time i try to
fetch i am getting this error and i am running this on https too and i have also tried using ngrok but still getting the sam error and when i try to fetch it using thunderclient or postman i am able to get the response so please help me out what is actually happening here
fetch i am getting this error and i am running this on https too and i have also tried using ngrok but still getting the sam error and when i try to fetch it using thunderclient or postman i am able to get the response so please help me out what is actually happening here
export async function POST(request: Request) {
try {
const { customerId } = await request.json();
if (!customerId) {
return new Response(
JSON.stringify({ error: "Customer ID is required" }),
{
status: 400,
headers: { "Content-Type": "application/json" },
}
);
}
const response = await fetch(
`https://enigma.fm/api/v1/subscriptions/${customerId}/billing-history`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
// Add any necessary authentication headers
},
}
);
if (!response.ok) {
throw new Error("Failed to fetch subscription data");
}
const data = await response.json();
return new Response(JSON.stringify(data), {
status: 200,
headers: { "Content-Type": "application/json" },
});
} catch (error) {
console.error("Error fetching subscription:", error);
return new Response(
JSON.stringify({ error: "Failed to fetch subscription data" }),
{
status: 500,
headers: { "Content-Type": "application/json" },
}
);
}
}7 Replies
Citrine WagtailOP
here i am able to get the response
with the thunderclient
It seems like node doesn't bundle the CA root used by enigma fm
One way to test if this is it:
https://stackoverflow.com/a/22263280
One way to test if this is it:
https://stackoverflow.com/a/22263280
@Julienng It seems like node doesn't bundle the CA root used by enigma fm
One way to test if this is it:
https://stackoverflow.com/a/22263280
Citrine WagtailOP
um this is from the vercel log
Citrine WagtailOP
@Julienng okay so i have the both api and the client side working on the same domain which have the certificate too but still getting this error
Citrine WagtailOP
guyys please help me out this is a serious issuee
i have the cert too