Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed all deprecated API usages in TestSslServer

  • Loading branch information...
commit bc98ba6f1916910e565738d96c0601f145ff56c8 1 parent 295efec
@dnene dnene authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 src/test/scala/in/hattip/testserver/TestSslServer.scala
View
15 src/test/scala/in/hattip/testserver/TestSslServer.scala
@@ -12,6 +12,7 @@ import com.weiglewilczek.slf4s.Logger
import org.eclipse.jetty.servlet.ServletContextHandler
import org.eclipse.jetty.servlet.ServletHolder
import in.hattip.client.Hattip._
+import org.eclipse.jetty.util.ssl.SslContextFactory
@RunWith(classOf[JUnitRunner])
class TestSslServer extends SpecificationWithJUnit with BeforeExample with AfterExample {
@@ -40,13 +41,15 @@ class SslServlet extends ScalatraServlet with FileUploadSupport {
class SslServer {
val server = new Server()
- val connector = new SslSocketConnector()
+ val factory = new SslContextFactory()
+ factory.setKeyStorePath("src/test/resources/keystore")
+ factory.setKeyStorePassword("keystore")
+ factory.setKeyManagerPassword("keystore")
+ factory.setTrustStore("src/test/resources/keystore")
+ factory.setTrustStorePassword("keystore")
+
+ val connector = new SslSocketConnector(factory)
connector.setPort(8443)
- connector.setKeystore("src/test/resources/keystore")
- connector.setKeyPassword("keystore")
- connector.setPassword("keystore")
- connector.setTruststore("src/test/resources/keystore")
- connector.setTrustPassword("keystore")
server.addConnector(connector)
val context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
Please sign in to comment.
Something went wrong with that request. Please try again.