+str #22345 #21854 provide forward compatible TLS constructor in stream TLS

This method will be consumed mainly by akka-http.

(cherry picked from commit 7b7a82c1c13dce5710c6cc2923fc7490666d8c79)
This commit is contained in:
Johannes Rudolph 2017-02-21 11:00:25 +01:00
parent e4491a05cf
commit 9be52cb2c9

View file

@ -167,6 +167,20 @@ object TLS {
closing: TLSClosing
): scaladsl.BidiFlow[SslTlsOutbound, ByteString, ByteString, SslTlsInbound, NotUsed] =
new scaladsl.BidiFlow(TlsModule(Attributes.none, _ createSSLEngine(), (_, session) verifySession(session), closing))
/**
* Create a StreamTls [[akka.stream.scaladsl.BidiFlow]]. This is a low-level interface.
*
* You can specify a constructor to create an SSLEngine that must already be configured for
* client and server mode and with all the parameters for the first session.
*
* For a description of the `closing` parameter please refer to [[TLSClosing]].
*/
def apply(
createSSLEngine: () SSLEngine, // we don't offer the internal `ActorSystem => SSLEngine` API here, see #21753
closing: TLSClosing
): scaladsl.BidiFlow[SslTlsOutbound, ByteString, ByteString, SslTlsInbound, NotUsed] =
apply(createSSLEngine, _ Success(()), closing)
}
/**