getting 525 response when using fetch to a specific remote domain

hey guys, I have been struggling all day with a 525 error code. Trying to run a fetch request...that works in the sandbox of the api I am making a request to without issue, as well as in postman, but when running from my worker app....525. What's crazy is it was working not too long ago. That said, I am reading here: https://community.cloudflare.com/t/ssl-525-problem-when-calling-an-api-from-cloudflare-worker/356930/13 that the only solution is to create a ticket with cloudflare and that its related to the cloudflare not handling the ssl handshake properly. Is that true or does anybody here have any other suggestions? If there are any cloudflare staff, attempting to hit an endpoint that includes: https://sandbox.dev.clover.com/v3/merchants/ Thank you
Cloudflare Community
SSL 525 problem when calling an API from Cloudflare Worker
The problem was not when displaying the page, but rather when submitting the subscription form (calling Revue API with a POST request) The CF proxy was already turned on: And we can subscribe successfully with these 2 URLs (same deployment) https://cf.thisweekinreact.com/ https://this-week-in-react.pages.dev/ I did not change anything si...
13 Replies
Erisa
Erisa6mo ago
Hello @captain, I attempted to reproduce the issue with the information provided by using the following code
export default {
async fetch(request, env, ctx) {
return fetch ("https://sandbox.dev.clover.com/v3/merchants/")
},
};
export default {
async fetch(request, env, ctx) {
return fetch ("https://sandbox.dev.clover.com/v3/merchants/")
},
};
However I recieve the expected 401, rather than a 525 response. Are you able to share a URL that reproduces the issue so that I can trace/inspect the request and try to find the cause?
captain
captain6mo ago
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer 6b85c7c9-4291-f107-3897-7e5820c32864");

var raw = JSON.stringify({
"taxable": true,
"isDefault": "false",
"filterCategories": "false",
"isHidden": "false",
"isDeleted": "false",
"label": "Online: Pickup Postman 2 Cool",
"hoursAvailable": "ALL"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://sandbox.dev.clover.com/v3/merchants/P04KSV7HVC601/order_types", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer 6b85c7c9-4291-f107-3897-7e5820c32864");

var raw = JSON.stringify({
"taxable": true,
"isDefault": "false",
"filterCategories": "false",
"isHidden": "false",
"isDeleted": "false",
"label": "Online: Pickup Postman 2 Cool",
"hoursAvailable": "ALL"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://sandbox.dev.clover.com/v3/merchants/P04KSV7HVC601/order_types", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Erisa
Erisa6mo ago
Still not getting it: https://worker-lucky-wildflower-d21a.erisacf.workers.dev/ Do you have this deployed to your own URL?
captain
captain6mo ago
yes
Erisa
Erisa6mo ago
Could you share that please?
captain
captain6mo ago
i have it deployed inside a special portal i guess i dont know how exact to share, i actually just took that code block and hard coded it into my dev area and tested just before my code base does basically the same stuff and was getting the same error what would be the best way to share with you? did i loose you...
Erisa
Erisa6mo ago
If the same happens on an easy to reproduce dev environment then that would work too. But since this is likely going to depend on the exact account setup, it's better if we handle this in an email ticket. If you are on the Free plan and can't create the ticket please can you DM me your account ID and account email address so I can create a ticket to use?
captain
captain6mo ago
sure one moment while i find that
Erisa
Erisa6mo ago
Find zone and account IDs · Cloudflare Fundamentals docs
Once you set up a new account and add your domain to Cloudflare, you may need access to your zone and account IDs for API operations.
captain
captain6mo ago
@Erisa | Support Engineer sorry to bug on this...just updated the email, did testing and still getting a 525. Hoping to get an update soon, not sure if there is anything i can do on this. Thanks
Erisa
Erisa6mo ago
It's out of hours for me now, I'll check it tomorrow
captain
captain6mo ago
i think we are in different time zones, about how many hours for now would that be from now and are you waiting on a response from somebody else? For anybody having 525 issues, Erisa helped identify that the the Authenticated Origin Pulls option being turned on in my domain zone was interfering with how the endpoint I am making a fetch request to was handling the SSL handshake causing a 525 response. The solution was to turn off Authenticated Origin Pulls or to have the remote URL change their SSL server settings. I am not in control of the remote url so the quick solution was turning off Authenticated Origin Pulls.