1

Does anyone know how to easily setup https for a rest api in google compute engine ? I have currently a static ip and the api works over http but in the browser when I call it I get mixed content error because the client is server over https (firebase hosting)

Is it possible to setup https with only a static ip (and not a domain name) ?

-Jani

jani_r
  • 637
  • 1
  • 7
  • 18

2 Answers2

1

Is it possible to setup https with only a static ip (and not a domain name) ?

Yes, it is possible, but since 2016 you cannot purchase an SSL certificate with a public IP address. You can use a self-signed certificate but you will have even more browser issues. Not recommended.

Possible Options:

  1. Use your domain name (or purchase one) and use Let's Encrypt for SSL which is free and is one of your better options.
  2. Use a different service such as Cloud Run, Cloud Functions, Firebase or App Engine which offers SSL and does not require a domain name that you own as you can use Google's endpoint.
  3. Attach a Google Load Balancer in front of your Compute Engine instance and configure a front end with a Google Managed SSL certificate. However, this will require a domain name.

If you do not want to use your own domain name, then option #2 is your only choice.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
0

To setup https for a rest api in google compute engine:

1- You have to buy a domain 2- You have to buy an SSL certificate 3- create a load balance resource in Google Cloud to which I assign the domain and the certificate 4- You can install the certificate to the server directly

If you want to use https over IP instead of domain, please follow click here

Mahboob
  • 1,877
  • 5
  • 19