earldouglas/xsbt-web-plugin — pull request #165 by lucastorri (2014-04-23 14:27:04+00:00)
Title: Alternative configuration for SSL Connector in Tomcat

Hi,

I'm currently migrating a Scala web project from Maven to SBT and started using your plugin. Previously, we were using Apache's [tomcat7-maven-plugin](http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/), with which we had a working SSL configuration.

I tried to also use SSL with your plugin and, although I was able to get an SSL port open, Tomcat is failing to return anything from it:
```
$ curl -kv https://localhost:8443/app/
* About to connect() to localhost port 8443 (#0)
* Trying 127.0.0.1... connected
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS alert, Server hello (2):
* error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error
* Closing connection #0
curl: (35) error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error
```

On the other hand, the plain HTTP port returns content correctly:
```
vagrant@precise64:~$ curl -kv http://localhost:8080/pcur/
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected

...

* Connection #0 to host localhost left intact
* Closing connection #0
```

Looking at the [source code of the maven plugin](https://github.com/apache/tomcat-maven-plugin/blob/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java#L1145), I was able to identify that a different set of parameters/attributes are set. By using the same configuration, which is now on this pull request, I was able to get the HTTPS port working fine as well.

Said that, I was wondering if I might be doing something wrong on my configuration or if maybe this changes might be interesting for your project. Please let me know what do you think.

By the way, my `build.scala` file has the following settings:
```scala
lazy val root = project.in(file("."))
.aggregate(model, server)
.settings(containerSettings :_*)

lazy val model = project.in(file("model"))

lazy val server = project.in(file("server"))
.dependsOn(model)
.settings(webappSettings :_*)

lazy val container = Container("container")

lazy val containerSettings: Seq[Setting[_]] = Seq(
libraryDependencies ++= Seq(
"org.apache.tomcat.embed" % "tomcat-embed-core" % "7.0.22" % "container",
"org.apache.tomcat.embed" % "tomcat-embed-logging-juli" % "7.0.22" % "container",
"org.apache.tomcat.embed" % "tomcat-embed-jasper" % "7.0.22" % "container")
) ++ container.deploy("/app" -> server) ++
Seq(
port in container.Configuration := 8080,
ssl in container.Configuration := Some(("0.0.0.0", 8443, System.getProperty("maven.tomcat.keystoreFile"), System.getProperty("maven.tomcat.keystorePass"), System.getProperty("maven.tomcat.keystorePass"))))
```