TrustCore SDK NanoSSL API reference  version 7.0
Asynchronous Server Functions

Asynchronous NanoSSL server functions. More...

Functions

MOC_EXTERN sbyte4 SSL_ASYNC_acceptConnection (TCP_SOCKET tempSocket, struct certStore *pCertStore)
 Register a secure asynchronous SSL/TLS connection. More...
 
MOC_EXTERN sbyte4 SSL_ASYNC_acceptConnectionAlt (TCP_SOCKET tempSocket, void *pCertStore)
 Wrapper function to register a secure asynchronous SSL/TLS connection. More...
 

Detailed Description

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

Function Documentation

◆ SSL_ASYNC_acceptConnection()

MOC_EXTERN sbyte4 SSL_ASYNC_acceptConnection ( TCP_SOCKET  tempSocket,
struct certStore *  pCertStore 
)

This function registers a secure asynchronous SSL/TLS connection.

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_SERVER_API__

ssl.h

Parameters
tempSocketSocket or TCP identifier returned by a call to accept().
pCertStorePointer 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 servers only.
Note
This function must be called from within the HTTPS daemon context. If you are using multiple HTTPS daemons, you must use a semaphore (mutex) around this function call.
If your web server and application server run as separate tasks, you should protect the call to SSL_ASYNC_acceptConnection() with a semaphore to prevent race conditions.

ssl.c

◆ SSL_ASYNC_acceptConnectionAlt()

MOC_EXTERN sbyte4 SSL_ASYNC_acceptConnectionAlt ( TCP_SOCKET  tempSocket,
void *  pCertStore 
)

This function is used by the NanoSSL Shim layer to register a secure asynchronous SSL/TLS connection.

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_SERVER_API__
  • __ENABLE_MOCANA_OPENSSL_SHIM__

ssl.h

Parameters
tempSocketSocket or TCP identifier returned by a call to accept().
pCertStorePointer to the SoT Platform certificate store that contains the SSL connection's certificates.
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