Reputation: 803
I'm trying to access an express.js node server I'm hosting on GCP and I'm getting this error:
This site can’t provide a secure connection
<server ip> sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
I looked at another stack overflow answer and they said to edit default-allow-internal
in the network tab to allow all, my network tab looks like this now:
My server starts fine and I know the logic inside works (it contains a scraper that logs to the console every time it runs and I can see it's succeeding there) But I can't access it via it's external IP https://<ip>:8000
Upvotes: 0
Views: 274
Reputation: 3220
As @Zac Anger suggested the easiest option is to use Load Balancer for terminating SSL at your server.
As given in the document:
HTTP(S) load balancing can balance HTTP and HTTPS traffic across multiple backend instances, across multiple regions. Your entire app is available via a single global IP address, resulting in a simplified DNS setup. HTTP(S) load balancing is scalable, fault-tolerant, requires no pre-warming, and enables content-based load balancing. For HTTPS traffic, it provides SSL termination and load balancing.
To terminate SSL follow the below steps:
Create an instance group that has at least 1 live instance.
Create http load balancer with the following:
Upload a SSL certificate.
Create a backend service to point to the instance group. Make sure the protocol is HTTP.
Create a target https proxy with the certificate you uploaded.
Finally, create a global forwarding rule that points HTTPS to the target proxy you created before.
Upvotes: 2