2

I want to write a small back-end REST server using Play! Framework 2.1.3. This server will only serve WS requests, and all communication to it must be made over SSL. For this reason, I don't want to have an HTTP port open for this server at all.

I've seen this question regarding SSL on various Play! branches, and according to the linked discussion, the only way to open SSL port (which worked for me) is to add JAVA_OPTS before running the server, like so:

JAVA_OPTS=-Dhttps.port=9443 play run

This setting opens both HTTP and HTTPS ports for communication.

My questions are:

  1. Is it possible to open the server only for SSL communication? How?
  2. Is there a configuration file where I put this setting?

Thanks!

Community
  • 1
  • 1
Hila
  • 1,080
  • 1
  • 9
  • 22

1 Answers1

1

This is super easy with Play 2.2, not sure it works on 2.1.3, I didn't see it in the 2.1.x docs...but was in the 2.2.x docs...so give it a shot, it might be implemented.

Throw this in your configuration file :

http.port=disabled

Or you could run it with the command line option :

-Dhttp.port=disabled

http://www.playframework.com/documentation/2.2.x/ConfiguringHttps

Kevin Mansel
  • 2,351
  • 1
  • 16
  • 15