Type Alias


A pointer to a customized read function that secure transport calls to read data from the connection.


typedef OSStatus (*SSLReadFunc)(SSLConnectionRef connection, void *data, size_t *dataLength);



A connection reference.


On return, your callback should overwrite the memory at this location with the data read from the connection.


On input, a pointer to an integer representing the length of the data in bytes. On return, your callback should overwrite that integer with the number of bytes actually transferred.

Return Value

Your callback must return an appropriate result code. See Secure Transport Result Codes.


Before using the secure transport API, you must create a read function (conforming to the SSLReadFunc prototype) and a write function (conforming to the SSLWriteFunc prototype) and provide them to the library by calling the SSLSetIOFuncs function.

You may configure the underlying connection to operate in a non-blocking manner; in that case, a read operation may well return errSSLWouldBlock, indicating less data than requested was transferred and nothing is wrong except that the requested I/O hasn’t completed. This result is returned to the caller from the functions SSLRead, SSLWrite, or SSLHandshake.

See Also

Context Callbacks


Specifies callback functions that perform the network I/O operations.


A pointer to a customized write function that secure transport calls to write data to the connection.