TrustCore SDK NanoSSL API reference  version 7.0
Asynchronous Client Functions

Asynchronous NanoSSL client functions. More...

Functions

MOC_EXTERN sbyte4 SSL_ASYNC_connect (TCP_SOCKET tempSocket, ubyte sessionIdLen, ubyte *sessionId, ubyte *masterSecret, const sbyte *dnsName, struct certStore *pCertStore)
 Create an asynchronous client connection context. More...
 
MOC_EXTERN sbyte4 SSL_ASYNC_connectAlt (TCP_SOCKET tempSocket, ubyte sessionIdLen, ubyte *sessionId, ubyte *masterSecret, const sbyte *dnsName, void *certStore)
 Wrapper function to create an asynchronous client connection context. More...
 
MOC_EXTERN sbyte4 SSL_ASYNC_start (sbyte4 connectionInstance)
 Start establishing a secure client-server connection. More...
 

Detailed Description

See also
Asynchronous Client and Server Functions
Core (Async and Sync) Client Functions
Core (Async and Sync) Client and Server Functions

Function Documentation

◆ SSL_ASYNC_connect()

MOC_EXTERN sbyte4 SSL_ASYNC_connect ( TCP_SOCKET  tempSocket,
ubyte  sessionIdLen,
ubyte *  sessionId,
ubyte *  masterSecret,
const sbyte *  dnsName,
struct certStore *  pCertStore 
)

This function creates a connection context for a secure SSL/TLS asynchronous connection with a remote server.

Since
1.41
Version
3.06 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__

ssl.h

Parameters
tempSocketSocket or TCB identifier returned by a call to connect().
sessionIdLenNumber of bytes in sessionId, excluding the NULL terminator.
sessionIdPointer to session ID.
masterSecretPointer to master secret for the session.
dnsNamePointer to expected DNS name of the server's certificate.
certStorePointer to SoT Platform certificate store that contains the SSL connection's certificate (as a trust point or identity).
Returns
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.
Remarks
This function is applicable to asynchronous clients only.

ssl.c

◆ SSL_ASYNC_connectAlt()

MOC_EXTERN sbyte4 SSL_ASYNC_connectAlt ( TCP_SOCKET  tempSocket,
ubyte  sessionIdLen,
ubyte *  sessionId,
ubyte *  masterSecret,
const sbyte *  dnsName,
void *  certStore 
)

This function is used by the NanoSSL Shim layer to create a connection context for a secure SSL/TLS asynchronous connection with a remote server.

Since
6.5
Version
6.5 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__
  • __ENABLE_MOCANA_OPENSSL_SHIM__

ssl.h

Parameters
tempSocketSocket or TCP identifier returned by a call to connect().
sessionIdLenNumber of bytes in sessionId, excluding the NULL terminator.
sessionIdPointer to session ID.
masterSecretPointer to master secret for the session.
dnsNamePointer to expected DNS name of the server's certificate.
certStorePointer to SoT Platform certificate store that contains the SSL connection's certificate (as a trust point or identity).
Returns
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.
Remarks
This function is applicable to asynchronous clients and servers.

ssl.c

◆ SSL_ASYNC_start()

MOC_EXTERN sbyte4 SSL_ASYNC_start ( sbyte4  connectionInstance)

This function begins the process of establishing a secure connection between a client and server by sending an SSL Hello message to a server.

Since
1.41
Version
1.41 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__

ssl.h

Parameters
connectionInstanceConnection instance returned from SSL_ASYNC_connect().
Returns
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.
Remarks
This function is applicable to asynchronous clients only.