Permalink
Browse files

! io, can, util: Publish SSLSessionEstablished event from SslTlsSuppo…

…rt upon successful SSL handshaking
  • Loading branch information...
mpilquist committed Sep 9, 2013
1 parent 2470440 commit 80982d48bf09ce7c5144dacb33acfeefa9c216ef
View
@@ -66,6 +66,7 @@ object Build extends Build with DocSupport {
lazy val sprayHttp = Project("spray-http", file("spray-http"))
+ .dependsOn(sprayUtil)
.settings(sprayModuleSettings: _*)
.settings(osgiSettings(exports = Seq("spray.http")): _*)
.settings(libraryDependencies ++=
@@ -84,7 +84,7 @@ private[can] object HttpClientConnection {
ResponseParsing(parserSettings) >>
RequestRendering(settings) >>
ConnectionTimeouts(idleTimeout) ? (reapingCycle.isFinite && idleTimeout.isFinite) >>
- SslTlsSupport >>
+ SslTlsSupport(false) >>
TickGenerator(reapingCycle) ? (idleTimeout.isFinite || requestTimeout.isFinite)
}
@@ -200,7 +200,7 @@ private[can] object HttpServerConnection {
RequestParsing(settings) >>
ResponseRendering(settings) >>
ConnectionTimeouts(idleTimeout) ? (reapingCycle.isFinite && idleTimeout.isFinite) >>
- SslTlsSupport ? sslEncryption >>
+ SslTlsSupport(false) ? sslEncryption >>
TickGenerator(reapingCycle) ? (reapingCycle.isFinite && (idleTimeout.isFinite || requestTimeout.isFinite)) >>
BackPressureHandling(backpressureSettings.get.noAckRate, backpressureSettings.get.readingLowWatermark) ? backpressureSettings.isDefined
}
@@ -158,7 +158,7 @@ class SslTlsSupportSpec extends Specification with NoTimeConversions {
val handler = system.actorOf(
props = Props {
new ConnectionHandler {
- val receiver = running(connection, frontend >> SslTlsSupport, sslTlsContext[ClientSSLEngineProvider](connected))
+ val receiver = running(connection, frontend >> SslTlsSupport(true), sslTlsContext[ClientSSLEngineProvider](connected))
def receive: Receive = receiver orElse {
case HookNetwork(hook) context.become(hooked(hook))
@@ -184,6 +184,7 @@ class SslTlsSupportSpec extends Specification with NoTimeConversions {
def run(): Unit = {
probe.send(handler, Tcp.Write(ByteString("3+4\n")))
+ probe.expectMsgType[SslTlsSupport.SSLSessionEstablished]
expectReceived(probe, ByteString("7\n"))
probe.send(handler, Tcp.Write(ByteString("20+22\n")))
expectReceived(probe, ByteString("42\n"))
@@ -269,7 +270,7 @@ class SslTlsSupportSpec extends Specification with NoTimeConversions {
val handler = system.actorOf(
props = Props {
new ConnectionHandler {
- def receive = running(connection, frontend >> SslTlsSupport, sslTlsContext[ServerSSLEngineProvider](x))
+ def receive = running(connection, frontend >> SslTlsSupport(true), sslTlsContext[ServerSSLEngineProvider](x))
}
},
name = "server" + counter.incrementAndGet())
Oops, something went wrong.

0 comments on commit 80982d4

Please sign in to comment.