Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play-framework [2.0] HTTPS

i'me working on a web server using play framework 2.0, where the login is executed by a android device software we're also making. And are main concern is that we can't find any support for HTTPS in play 2.0. Sense this is a school project we can't aford clouds nor other proxy to solve the HTTPS for us.

Our main problem is the password and email going in plain sight in the request's body, encrypting and decrypting in the mobile device and on the server looks costly in performance and sense HTTPS takes care of this we wanted to avoid it. Is there any way we can use HTTPS to protect the users login data, or any other suggestion.

If not we might have to migrate all are application to another framework, because it wont look good important confidential data going through the internet without encryption.

like image 830
Hugo Alves Avatar asked Mar 29 '12 11:03

Hugo Alves


People also ask

How do I run Play Framework?

For running Play Framework applications with Intellij Idea tools you need to download and install Scala plugin. You can run you play-app via command line executing play run under the application root directory.

Is Play Framework open source?

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.


2 Answers

Historically, I've seen most folks run the Java/Scala application server behind a reverse proxy of some kind. Setting up HTTPS in apache isn't too hard, and then just use ModProxy to send requests internally to your Play application.

Any one of the reverse proxy systems can likely do this, nginx is popular too, and generally has easier configuration than apache, but I've never used it with HTTPS.

The number one reason normally to do this is security. You can't start a Java program as a non privileged user on port 80. If you start your Java program as root running on port 80, then any hole in your application has root privileges! As a result, starting the Java app on another port, then reverse proxy from an web server that can run as a non-priveleged user on port 80.

(*) This is a slightly over-simplified, but a discussion of this weirdness is beyond the scope of this I think.

like image 104
PlexQ Avatar answered Oct 18 '22 23:10

PlexQ


It's now possible to use Play and https directly. This was added in Play 2.1

Simply start the server with:

JAVA_OPTS=-Dhttps.port=9001 play start
like image 2
Farmor Avatar answered Oct 18 '22 21:10

Farmor