From f0bbadce843df5eb8b2e25cd24238e2bc749cbad Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sun, 25 Apr 2010 23:11:28 +0200 Subject: [PATCH] Tests pass with Dummy SSL config! --- akka-core/src/main/scala/remote/RemoteClient.scala | 1 + akka-core/src/main/scala/remote/RemoteServer.scala | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/akka-core/src/main/scala/remote/RemoteClient.scala b/akka-core/src/main/scala/remote/RemoteClient.scala index 60cbfbdd36..5e90f3585b 100644 --- a/akka-core/src/main/scala/remote/RemoteClient.scala +++ b/akka-core/src/main/scala/remote/RemoteClient.scala @@ -251,6 +251,7 @@ class RemoteClientPipelineFactory(name: String, client: RemoteClient) extends ChannelPipelineFactory { def getPipeline: ChannelPipeline = { val engine = RemoteServerSslContext.client.createSSLEngine() + engine.setEnabledCipherSuites(engine.getSupportedCipherSuites) //TODO is this sensible? engine.setUseClientMode(true) val ssl = new SslHandler(engine) diff --git a/akka-core/src/main/scala/remote/RemoteServer.scala b/akka-core/src/main/scala/remote/RemoteServer.scala index 2cd5a6dd4f..1b646e1fe9 100644 --- a/akka-core/src/main/scala/remote/RemoteServer.scala +++ b/akka-core/src/main/scala/remote/RemoteServer.scala @@ -289,19 +289,19 @@ object RemoteServerSslContext { val protocol = "TLS" val algorithm = Option(Security.getProperty("ssl.KeyManagerFactory.algorithm")).getOrElse("SunX509") val store = KeyStore.getInstance("JKS") - store.load(getClass.getResourceAsStream("keystore"),"keystorepassword".toCharArray) + store.load(DummyKeyStore.asInputStream,DummyKeyStore.getKeyStorePassword) //TODO replace with getResourceAsStream + config-pass val keyMan = KeyManagerFactory.getInstance(algorithm) - keyMan.init(store, "certificatepassword".toCharArray) + keyMan.init(store, DummyKeyStore.getCertificatePassword) //TODO replace with config-pass - val trustMan = TrustManagerFactory.getInstance("SunX509"); - trustMan.init(store) //TODO safe to use same keystore? Or should use it's own keystore? + //val trustMan = TrustManagerFactory.getInstance("SunX509"); + //trustMan.init(store) //TODO safe to use same keystore? Or should use it's own keystore? val s = SSLContext.getInstance(protocol) s.init(keyMan.getKeyManagers, null, null) val c = SSLContext.getInstance(protocol) - c.init(null, trustMan.getTrustManagers, null) + c.init(null, DummyTrustManagerFactory.getTrustManagers, null) //TODO replace with TrustManagerFactory (c,s) } @@ -320,6 +320,7 @@ class RemoteServerPipelineFactory( def getPipeline: ChannelPipeline = { val engine = RemoteServerSslContext.server.createSSLEngine() + engine.setEnabledCipherSuites(engine.getSupportedCipherSuites) //TODO is this sensible? engine.setUseClientMode(false) val ssl = new SslHandler(engine)