=str #22124 fix failing TlsSpec "certificate check"
It seems the reason for the failure was that `Sink.head` canceled the server binding before or while the first connection was being established and handled. Using `mapAsync` instead will prevent that the binding is canceled before the inner flow has finished.
This commit is contained in:
parent
9abb73069c
commit
7b9342e324
1 changed files with 3 additions and 3 deletions
|
|
@ -396,15 +396,15 @@ class TlsSpec extends StreamSpec("akka.loglevel=DEBUG\nakka.actor.debug.receive=
|
||||||
// under error conditions, and has the bonus of matching most actual SSL deployments.
|
// under error conditions, and has the bonus of matching most actual SSL deployments.
|
||||||
val (server, serverErr) = Tcp()
|
val (server, serverErr) = Tcp()
|
||||||
.bind("localhost", 0)
|
.bind("localhost", 0)
|
||||||
.map(c ⇒ {
|
.mapAsync(1)(c ⇒
|
||||||
c.flow.joinMat(serverTls(IgnoreBoth).reversed.joinMat(simple)(Keep.right))(Keep.right).run()
|
c.flow.joinMat(serverTls(IgnoreBoth).reversed.joinMat(simple)(Keep.right))(Keep.right).run()
|
||||||
})
|
)
|
||||||
.toMat(Sink.head)(Keep.both).run()
|
.toMat(Sink.head)(Keep.both).run()
|
||||||
|
|
||||||
val clientErr = simple.join(badClientTls(IgnoreBoth))
|
val clientErr = simple.join(badClientTls(IgnoreBoth))
|
||||||
.join(Tcp().outgoingConnection(Await.result(server, 1.second).localAddress)).run()
|
.join(Tcp().outgoingConnection(Await.result(server, 1.second).localAddress)).run()
|
||||||
|
|
||||||
Await.result(serverErr.flatMap(identity), 1.second).getMessage should include("certificate_unknown")
|
Await.result(serverErr, 1.second).getMessage should include("certificate_unknown")
|
||||||
Await.result(clientErr, 1.second).getMessage should equal("General SSLEngine problem")
|
Await.result(clientErr, 1.second).getMessage should equal("General SSLEngine problem")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue