Function

SSLGetNegotiatedProtocolVersion

Obtains the negotiated protocol version of the active session.

Declaration

OSStatus SSLGetNegotiatedProtocolVersion(SSLContextRef context, SSLProtocol *protocol);

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 kSSLProtocolUnknown 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

See Also

Versions

SSLSetProtocolVersionMax

Sets the maximum protocol version allowed by the application for a given SSL context.

Deprecated
SSLSetProtocolVersionMin

Sets the minimum protocol version allowed by the application for a given SSL context.

Deprecated
SSLGetProtocolVersionMax

Gets the maximum protocol version allowed by the application for a given SSL context.

Deprecated
SSLGetProtocolVersionMin

Gets the minimum protocol version allowed by the application for a given SSL context.

Deprecated
tls_protocol_version_t

The collection of supported TLS and DTLS versions.

Beta
SSLProtocol

An enumeration of valid SSL protocol versions.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software