TlsSession

class TlsSession

This class represents a TLS session. It manages the context for the session, which is used for input as well as output streams.

  • The state of the TLS session.

    Declaration

    Swift

    var state: SSLSessionState { get }
  • This function is called when there is space available for the handshake. When called it will initiate a TLS handshake or send additional data in order to complete the handshake (it is a two-way process).

    Declaration

    Swift

    func spaceAvailableForHandshake()
  • This function is called when there are bytes available for the handshake.

    Declaration

    Swift

    func bytesAvailableForHandshake()
  • Initiate a TLS handshake.

    Declaration

    Swift

    private func shakeHands() -> OSStatus

    Return Value

    A status returned by the secure transport library.

  • Deceide how to handle the result while shaking hands. If there is no error, the streams will be opened. If the current handshake blocks, it needs to be continue, either by writing some more data, if space is available, or by waiting for a response of the target.

    Declaration

    Swift

    private func handleHandshakeResult(status: OSStatus)

    Parameters

    status

    The status from the secure transport library.