Enabling SSL

There are two ways of enabling SSL for our application. We can either serve an HTTPS application by the providing the required configuration for it on start, or by proxying the requests through an SSL-enabled web server. In this section, we will see how the first option can be used and the latter will be covered in the next section.

We can choose to run both the HTTP and HTTPS versions or just opt for one of them using the http.port and https.port settings. By default, HTTPS is disabled and we can enable it by specifying https.port as follows:

#setting https port to 1234
[PlayScala] $ start -Dhttps.port=1234

#disabling http port and setting https port to 1234
[PlayScala] $ start -Dhttp.port=disabled -Dhttps.port=1234

Play generates ...

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.