Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

https only in google app engine

I am on a google app engine project now. In my application I have to allow only https protocol. And I have to restrict other protocols. It should allow https only. I have added the below code in web.xml.

<security-constraint>     <web-resource-collection>         <web-resource-name>Protected Area</web-resource-name>         <url-pattern>/*</url-pattern>     </web-resource-collection>     <user-data-constraint>         <transport-guarantee>CONFIDENTIAL</transport-guarantee>     </user-data-constraint> </security-constraint> 

But after deploying it works on both the protocols(http and https). How to restrict http?

like image 246
DonX Avatar asked Mar 20 '11 10:03

DonX


People also ask

What does Google App Engine offer?

App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. You can choose from several popular languages, libraries, and frameworks to develop your apps, and then let App Engine take care of provisioning servers and scaling your app instances based on demand.

Is Google App Engine deprecated?

In Google I/O 2011, Google announced App Engine Backends, which are allowed to run continuously, and consume more memory. The Backend API was deprecated as of March 13, 2014 in favor of the Modules API.

What is Google App Engine example?

Examples of Google App Engine. One example of an application created in GAE is an Android messaging app that stores user log data. The app can store user messages and write event logs to the Firebase Realtime Database and use it to automatically synchronize data across devices.


1 Answers

It is possible to configure the individual handlers to require HTTPS in the app.yaml file in the WEB-INF folder as described here: Java Application Configuration Using app.yaml - Google App Engine.

You just have to add these two words to your app.yaml file under the appropriate url entry:
secure: always

For example:

- url: .*   script: main.app   secure: always 

Then if a user tries to access the URL with HTTP she will be automatically redirected to HTTPS. Pretty cool.

like image 133
zengabor Avatar answered Sep 28 '22 10:09

zengabor