![]() |
TrustCore SDK NanoSSL API reference
version 7.0
|
Customizable NanoSSL asynchronous and synchronous, server and client callbacks. More...
Variables | |
sbyte4(* | sslSettings::funcPtrAlertCallback )(sbyte4 connectionInstance, sbyte4 alertId, sbyte4 alertClass) |
Do application-specific work required when the alert is received. More... | |
sbyte4(* | sslSettings::funcPtrNewHandshakeCallback )(sbyte4 connectionInstance, sbyte4 *pRetDoRehandshake, sbyte4 *pRetDoSessionResumption) |
Determine whether to grant or ignore a client or server rehandshake request. More... | |
The following callbacks can be customized for your application:
sbyte4(* sslSettings::funcPtrAlertCallback) (sbyte4 connectionInstance, sbyte4 alertId, sbyte4 alertClass) |
This callback function does any application-specific work required when the alert is received.
For example, a typical response upon receiving an SSL_ALERT_ACCESS_DENIED
error would be to notify the client application that this error has occurred.
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_ALERTS__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_CLIENT__
__ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
alertId | SSL alert code (see ssl_alert_codes). |
alertClass | Alert class (SSLALERTLEVEL_WARNING or SSLALERTLEVEL_FATAL ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrNewHandshakeCallback) (sbyte4 connectionInstance, sbyte4 *pRetDoRehandshake, sbyte4 *pRetDoSessionResumption) |
This callback function determines whether to grant or ignore a client or server rehandshake rehandshake request. For example, this callback could count the number of rehandshake requests received, and choose to ignore the request after an excessive number of attempts (which could indicate a DoS attack).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_NEW_HANDSHAKE__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_CLIENT__
__ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pRetDoRehandshake | On return, pointer to TRUE if request should be granted; otherwise, pointer to FALSE . |
pRetDoSessionResumption | On return, pointer to TRUE if request should be granted; otherwise, pointer to FALSE . |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.