How to run jetty with https using sbt
I am using jetty 2.6.1 and sbt 0.7.7.
Currently my app is running on http, but I want to run with https
I tried following approach to run it with https :
http://wiki.eclipse.org/Jetty/Howto/Configure_SSL#Configuring_Jetty_for_SSL
Then i set below code in build.scala file.
override lazy val jettyInstance = new
JettyRunner(customJettyConfiguration)
def customJettyConfiguration = {
val myLog = log
val myJettyClasspath = jettyClasspath
new CustomJettyConfiguration {
def war = "target/scala_2.8.0/tos.war"
def scanDirectories = Nil
def scanInterval = 0
def jettyClasspath = myJettyClasspath
def classpath = jettyRunClasspath
def classpathName = "test"
def log = myLog
override def jettyConfigurationXML =
<Configure id="Server" class="org.mortbay.jetty.Server">
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.security.SslSocketConnector">
<Set name="Port">443</Set>
<Set name="maxIdleTime">30000</Set>
<Set name="handshakeTimeout">2000</Set>
<Set name="keystore"><SystemProperty name="jetty.home"
default=""/>/etc/xinetd.d/keystore</Set>
<Set name="password">password</Set>
<Set name="keyPassword">password</Set>
<Set name="truststore"><SystemProperty name="jetty.home"
default=""/>/etc/xinetd.d/keystore</Set>
<Set name="trustPassword">password</Set>
<Set name="handshakeTimeout">2000</Set>
</New>
</Arg>
</Call>
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="host"><SystemProperty name="jetty.host"/></Set>
<Set name="port"><SystemProperty name="jetty.port"
default="8080"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">5000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
</Configure>
}
}
But I did not get my work done.
Please let me know , if i am doing anything wrong.
No comments:
Post a Comment