Node.js, HTTPS, and WebSocket Configuration Challenges

Hello, I am attempting to establish a connection between my website and a WebSocket server through CF.

My website is powered by Node.js and is running on port 80, while the WebSocket server is also utilizing Node.js and operating on port 443.

For both of these services, I am setting up an HTTPS server and providing the key.pem and cert.pem files that I obtained from the Origin Server tab. When I set the SSL/TLS encryption to “Full” or “Full (Strict),” I encounter an “Invalid SSL certificate Error code 526” error. On the other hand, when I use the “Flexible” option, I receive a “Web server is returning an unknown error Error code 520.”

If I do not create an HTTPS server on the web server, the website works, but only when the Cloudflare SSL mode is set to “Flexible.” Unfortunately, even in this configuration, the WebSocket functionality remains non-operational.

I have ensured that WebSockets and HTTPS rewrite are enabled in the Cloudflare control panel. I’ve also checked the firewall settings and confirmed that CF is not being obstructed.

I would greatly appreciate any assistance or guidance in resolving these issues.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.