Karthik
Karthik

Reputation: 343

Making https default for GAE java application with domain on NameSilo

I spent considerable time and figured out most parts but I am stuck at the last piece. I have a GAE java web application with domain from Namesilo, I enabled https by enabling managed security and now I am able to access the domain with https:// and http://.

Like all applications on net today and for SEO boost, I would like to make https default option for my domain/application.

I have tried doing 301 permanent forwarding in Namesilo to https://. However that is overriding the CNAME and A records in Namesilo and also, the forwarding to https is not working. I am not able to find much material on the net about this.

Can anyone please help or provide pointers on how to make https default for GAE java app with Namesilo domain.

Upvotes: 0

Views: 77

Answers (2)

Karthik
Karthik

Reputation: 343

Dan had pointed me in the right direction. In addition to marking ssl-enabled to true, I had to set the security-constraint in web.xml also as below from one of the other StackOverflow answers (stackoverflow.com/questions/5367974/…)

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

Upvotes: 1

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

In the standard environment you can use the <ssl-enabled> config option in the appengine-web.xml file to require HTTPS, which causes an automatic redirection. From Syntax:

<ssl-enabled>

Optional. By default, any user can access any URL using either HTTP or HTTPS. You can configure an app to require HTTPS for certain URLs in the deployment descriptor. See Deployment Descriptor: Secure URLs.

Upvotes: 1

Related Questions