TrustCore SDK NanoSSL API reference  version 7.0
Synchronous Server Functions

Synchronous NanoSSL server functions. More...

Functions

MOC_EXTERN sbyte4 SSL_acceptConnection (TCP_SOCKET tempSocket, struct certStore *pCertStore)
 Create a synchronous server connection context. More...
 

Detailed Description

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

Function Documentation

◆ SSL_acceptConnection()

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

This function performs SSL handshaking, establishing a secure connection between a server and client.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSL_SERVER__

ssl.h

Parameters
tempSocketSocket or TCB 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.
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_acceptConnection with a semaphore to prevent race conditions.
Remarks
This function is applicable to synchronous servers only.

ssl.c