Question

Does Play2.0.x support Server Name Indication?

A pointer to docs or examples would be great.

I have the typical use case: I want to use name-based virtual hosting of "unrelated" Play2 appservers behind a shared load-balancer, doing SSL termination at the individual appservers.

Was it helpful?

Solution

Java 7 now supports SNI, but only on the client-side. This will be a problem if you want to to handle the connections directly from Java.

However, being behind a load-balancer should help you. If it can handle SNI (which is the case for modern versions of Apache Httpd, for example), you could reverse proxy to a server listening on different ports for each of the host names you want to use.

  • www.domain1.example ---reverse proxy---> 192.168.0.10:8080 (configured for application www.domain1.example)
  • www.domain2.example ---reverse proxy---> 192.168.0.10:8081 (configured for application www.domain2.example)

You'd have to let the load-balancer handle the SSL connection. Alternatively, if the load-balancer is sufficiently clever to dispatch to a different port after looking at the server name extension in the Client Hello initial TLS message, it might be able to do it this way (I'm not sure if any can).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top