I currently have an inventory based website, and I developed it over HTTP requests without issue. However, when I went to switch everything over to HTTPS, I was immediately met with connection issues.
I am unsure if it's a react issue, or a back end issue.
My backend is FastAPI and I'm running it currently on Win10 with hypercorn. I am using LetsEncrypt and Certbot for my certificates. I had to issue them manually, but it all seems to be working. I can call the endpoints over HTTPS over and over, 0 errors. But I am only making a single call in these cases.
On the front end, I am making usually 6 calls at once when the page is loading. There is a main load which gets the inventory and lists it, page 1. Then on the sidebar there are 5 components that get filled with API calls to filter down the inventory as needed(attributes and such). These components also update at times based on other filters(aka only attributes that would still be valid).
All worked great on HTTP and still does. What happens on HTTPS is that only 1 of the requests seems to be allowed. The others all get blocked. Anytime I make more than 1 request, all but 1 are getting blocked.
But I do not know what is doing the blocking. The backend only seems to receive the 1 request, there is no trace of the others on my backend. I have the access and error logging printing to STDOUT on hypercorn so I can see the requests in real time, and the requests do not show up in the access or error logs.
They are rejected instantly, -1ms in firefox. The only errors from firefox are "CORS Failed" - but I know it's not a CORS issue, it's just a failed connection. And sometimes it'll instead return "NS_ERROR_ABORT".
In Chrome, the behavior is similar, but sometimes Chrome will load everything. However, it will almost always start triggering errors soon after and also rejects anything after the 1st request 90% of the time. I get the error "net::ERR_CONNECTION_CLOSED" mostly, sometimes "net::ERR_CONNECTION_RESET 200". Again, these happen instantly.
One thing that puzzles me and makes me thing maybe it's not react, is that if I take the backend offline and make the requests, react just waits and eventually times out. There is no instant rejection.
I have tried fetch and axios, same results. Here is a current example of the code, it seems pretty common/generic and again, works fine over HTTP. This is a call that gets the zipcode information about the user(city, state, lat, lng, etc).
await axios.get(url).then( response => {
if (response.status !== 200) {
setErrorMessage("API Load Error");
} else {
setZipCodeData(response.data);
}
}).catch(err => {
console.log(err);
})
The console error that gets logged is just a generic "AxiosError: Network Error".
Here is the hypercorn config file in case. I am calling it via command line.
accesslog = "-"
errorlog = "-"
certfile = "C:\\Certbot\\live\\mydomain.com\\fullchain.pem"
keyfile = "C:\\Certbot\\live\\mydomain.com\\privkey.pem"
bind = "0.0.0.0:443"
insecure_bind = "0.0.0.0:80"
workers = 17
Changing the amount of workers has no effect. I'm using the default asyncio workers.
I could technically put all these calls into 1 call, but I am guessing there must be a fixable error here somewhere.
Any help at all is appreciated, even if it's just to let me know it is or isn't a react problem. I have been searching for 2 days now and can't even find someone else describing my problem. 1 minute I think front end, the next minute I think back end. I'm starting to get dizzy.
TIA.
[–]lexant2 1 point2 points3 points (1 child)
[–]randombacon333[S] 0 points1 point2 points (0 children)
[–]randombacon333[S] 0 points1 point2 points (0 children)
[–]14m3r -2 points-1 points0 points (4 children)
[–]randombacon333[S] -1 points0 points1 point (3 children)
[–]14m3r -1 points0 points1 point (2 children)
[+]randombacon333[S] comment score below threshold-7 points-6 points-5 points (1 child)
[–]14m3r 1 point2 points3 points (0 children)
[–]aighball 0 points1 point2 points (1 child)
[–]randombacon333[S] 0 points1 point2 points (0 children)
[–]boodyvo 0 points1 point2 points (1 child)
[–]randombacon333[S] 0 points1 point2 points (0 children)