Function

SSLSetPeerID

Specifies data that is sufficient to uniquely identify the peer of the current session.

Declaration

OSStatus SSLSetPeerID(SSLContextRef context, const void *peerID, size_t peerIDLen);

Parameters

context

An SSL session context reference.

peerID

A pointer to a buffer containing the peer ID data to set.

peerIDLen

The length of the peer ID data buffer.

Return Value

A result code. See Secure Transport Result Codes.

Discussion

Secure Transport uses the peer ID to match the peer of an SSL session with the peer of a previous session in order to resume an interrupted session. If the peer IDs match, Secure Transport attempts to resume the session with the same parameters as used in the previous session with the same peer.

The data you provide to this function is treated as an opaque blob by Secure Transport but is compared byte for byte with previous peer ID data values set by the current application. An example of peer ID data is an IP address and port, stored in some caller-private manner. Calling this function is optional but is required if you want the session to be resumable. If you do call this function, you must call it prior to the handshake for the current session.

You can use the SSLGetPeerID function to retrieve the peer ID data for the current session.

See Also

Session State

SSLHandshake

Performs the SSL handshake.

SSLReHandshake

Requests renegotiation of the SSL handshake. Server only.

SSLClose

Terminates the current SSL session.

SSLGetPeerID

Retrieves the current peer ID data.

SSLGetSessionState

Retrieves the state of an SSL session.

SSLSessionState

The flags that represent the state of an SSL session.

SSLSetError

Sets the status of a session context.