How to make Google cloud deployment use SSL?

50 views
Skip to first unread message

Uri Blackman

unread,
Oct 18, 2022, 12:55:25 AM10/18/22
to NYT Library Community
I deployed Library via Google cloud and created a domain alias with an ssl certificate, but whenever it authenticates it reverts to http:// instead of https://
This is even though I have the authorized redirect URIs both as http:// and https:// URLs.

I'm not too familiar with Google cloud, so any pointers in how to enable SSL access for the library app would be appreciated.

Thanks, Uri

Uri Blackman

unread,
Oct 18, 2022, 1:09:25 AM10/18/22
to NYT Library Community
To be more specific - it's just the initial authentication that redirects to http:// 
after it authenticates then I can switch to https:// and it works ok.
So the question is how do I make the default redirection to https:// instead of http://

Andrew Fischer

unread,
Oct 29, 2022, 12:42:39 PM10/29/22
to Uri Blackman, NYT Library Community
Hi Uri,

Which google service are you using to deploy the app? If it's Google App Engine, I think you may need to create (or edit if you have one) an app.yaml file with secure: always set. Full app.yaml documentation can be found here.

Let me know if that helps!

───
Andrew Fischer
Software Engineer, Interactive News



--
You received this message because you are subscribed to the Google Groups "NYT Library Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nyt-library-comm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nyt-library-community/4738055f-9332-45ac-85b0-a921e5f15b78n%40googlegroups.com.

Uri Blackman

unread,
Oct 29, 2022, 6:08:56 PM10/29/22
to NYT Library Community
Hi Andrew,

That worked great.

I added the following to library/app.yaml
handlers:
- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto


and then reloaded the instance with
gcloud app deploy ...

and it now defaults to https

Thanks, Uri
Reply all
Reply to author
Forward
0 new messages