I am unable to call an external API (Revue.co, the Twitter newsletter service) from a Cloudflare Worker
I get an SSL problem and a 525 status code from the fetch request.
I already posted this here, but for some reason the conversation got locked-up.
There are a few related posts with similar errors and suggested workarounds, none of them worked for me.
I tried all the global/page SSL settings combinations possible that I can think off (global/page off, flexible, full, strict), without success
I just send a request to some external https API:
async function subscribeToRevue({
email,
revueSecretKey,
}: {
email: string;
revueSecretKey: string;
}) {
const REVUE_SUBSCRIBE_API = "https://www.getrevue.co/api/v2/subscribers";
const revueFormData = new FormData();
revueFormData.append("email", email);
revueFormData.append("double_opt_in", "true");
const result = await fetch(REVUE_SUBSCRIBE_API, {
method: "POST",
headers: {
Authorization: `Token ${revueSecretKey}`,
},
body: revueFormData,
});
return result;
}
My domains:
https://cf.thisweekinreact.com/
https://this-week-in-react.pages.dev/
Code: this-week-in-react/index.tsx at main · slorber/this-week-in-react · GitHub
There’s nothing fancy being done, and it’s quite similar to your existing Egghead + Unsplash tutorial here: Make API Requests in a Workers Function Using the Fetch API | egghead.io
This works fine in Wranger/dev.
I also got this working on Vercel in 3 minutes, while I’m struggling for hours to make it work on Cloudflare.
I really wanted to give a try CF workers but if I’m unable to make it work I don’t know what else to do.
Can someone from support show me that the above code can technically work on Cloudflare? Using what config/workaround?
Thanks
Related to:
# Error 525
Ray ID: 6d9eb373ca1b40b1 • 2022-02-07 18:32:27 UTC
## SSL handshake failed
You
### Browser
Working
Paris
### Cloudflare
Working
cf.thisweekinreact.com
### Host
Error
## What happened?
Cloudflare is unable to establish an SSL connection to the origin server.
## What can I do?
### If you're a visitor of this website:
Please try again in a few minutes.
### If you're the owner of this website:
It appears that the SSL configuration used is not compatible with Cloudflare. This could happen for a several reasons, including no shared cipher suites. [Additional troubleshooting information here.](https://support.cloudflare.com/hc/en-us/articles/200278659)
Cloudflare Ray ID: **6d9eb373ca1b40b1** • Your IP: 2a01:cb00:ca6:de00:59c3:19b8:ed3:9294 • Performance & security by [Cloudflare](https://www.cloudflare.com/5xx-error-landing)