perwendel/spark — pull request #38 by FreudianNM (2013-02-13 00:28:19+00:00)
Title: Adding SSL secure sockets for embedded Jetty Server

Hi,

I've found Spark very helpful, and its beautifully put together too and I wanted to contribute to say 'thanks' so I thought maybe this might be useful (certainly I've found it useful). As says on tin, I've added (hopefully in a complementary style) support for using secure SSL with the jetty server.

Details are:

Added a 'setSecure' method to call before routing to set the embedded
Jetty server to use secure SSL Sockets with keystore of choice

Up-versioned jetty dependency to get SslContextFactory in support of
this.

Altered SparkTestUtils so that is can do secure connections to allow for
testing of new secure server. Will use supplied test keystore if needs
be, but this can be overriden by use of JVM SSL parameters, which are respected in
the test utility.

Let me know if this might be useful, or if there's anything you'd like changed.

Thanks,

Peter N.