Contents

SSLGetNegotiatedProtocolVersion(_:_:)

Obtains the negotiated protocol version of the active session.

Declaration

func SSLGetNegotiatedProtocolVersion(_ context: SSLContext, _ protocol: UnsafeMutablePointer<SSLProtocol>) -> OSStatus

Parameters

  • context:

    An SSL session context reference.

  • protocol:

    On return, points to the negotiated protocol version of the active session. The value is set to Sslprotocolunknown if no SSL session is in progress.

Return Value

A result code. See Secure Transport Result Codes.

Discussion

This function retrieves the version of the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol negotiated for the session. Note that the negotiated protocol may not be the same as your preferred protocol, depending on which protocol versions you enabled with the SSLSetProtocolVersionEnabled function. This function can return any of the following values:

  • kSSLProtocol2

  • kSSLProtocol3

  • kTLSProtocol1

  • kSSLProtocolUnknown