akka.stream.io

SslTls

object SslTls

Stream cipher support based upon JSSE.

The underlying SSLEngine has four ports: plaintext input/output and ciphertext input/output. These are modeled as a akka.stream.BidiShape element for use in stream topologies, where the plaintext ports are on the left hand side of the shape and the ciphertext ports on the right hand side.

Configuring JSSE is a rather complex topic, please refer to the JDK platform documentation or the excellent user guide that is part of the Play Framework documentation. The philosophy of this integration into Akka Streams is to expose all knobs and dials to client code and therefore not limit the configuration possibilities. In particular the client code will have to provide the SSLContext from which the SSLEngine is then created. Handshake parameters are set using NegotiateNewSession messages, the settings for the initial handshake need to be provided up front using the same class; please refer to the method documentation below.

IMPORTANT NOTE

The TLS specification does not permit half-closing of the user data session that it transports—to be precise a half-close will always promptly lead to a full close. This means that canceling the plaintext output or completing the plaintext input of the SslTls stage will lead to full termination of the secure connection without regard to whether bytes are remaining to be sent or received, respectively. Especially for a client the common idiom of attaching a finite Source to the plaintext input and transforming the plaintext response bytes coming out will not work out of the box due to early termination of the connection. For this reason there is a parameter that determines whether the SslTls stage shall ignore completion and/or cancellation events, and the default is to ignore completion (in view of the client–server scenario). In order to terminate the connection the client will then need to cancel the plaintext output as soon as all expected bytes have been received. When ignoring both types of events the stage will shut down once both events have been received. See also Closing.

Source
SslTls.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SslTls
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type JavaFlow = BidiFlow[SslTlsOutbound, ByteString, ByteString, SslTlsInbound, Unit]

  2. type ScalaFlow = BidiFlow[SslTlsOutbound, ByteString, ByteString, SslTlsInbound, Unit]

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply(sslContext: SSLContext, firstSession: NegotiateNewSession, role: Role, closing: Closing = IgnoreComplete): ScalaFlow

    Scala API: create a StreamTls akka.stream.scaladsl.BidiFlow.

    Scala API: create a StreamTls akka.stream.scaladsl.BidiFlow. The SSLContext will be used to create an SSLEngine to which then the firstSession parameters are applied before initiating the first handshake. The role parameter determines the SSLEngine’s role; this is often the same as the underlying transport’s server or client role, but that is not a requirement and depends entirely on the application protocol.

    For a description of the closing parameter please refer to Closing.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def create(sslContext: SSLContext, firstSession: NegotiateNewSession, role: Role, closing: Closing): JavaFlow

    Java API: create a StreamTls akka.stream.javadsl.BidiFlow in client mode.

    Java API: create a StreamTls akka.stream.javadsl.BidiFlow in client mode. The SSLContext will be used to create an SSLEngine to which then the firstSession parameters are applied before initiating the first handshake. The role parameter determines the SSLEngine’s role; this is often the same as the underlying transport’s server or client role, but that is not a requirement and depends entirely on the application protocol.

    For a description of the closing parameter please refer to Closing.

  10. def create(sslContext: SSLContext, firstSession: NegotiateNewSession, role: Role): JavaFlow

    Java API: create a StreamTls akka.stream.javadsl.BidiFlow in client mode.

    Java API: create a StreamTls akka.stream.javadsl.BidiFlow in client mode. The SSLContext will be used to create an SSLEngine to which then the firstSession parameters are applied before initiating the first handshake. The role parameter determines the SSLEngine’s role; this is often the same as the underlying transport’s server or client role, but that is not a requirement and depends entirely on the application protocol.

    This method uses the default closing behavior or IgnoreComplete.

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped