TrustCore SDK NanoSSL API reference  version 7.0
Synchronous Client Functions

Synchronous NanoSSL client functions. More...

Functions

MOC_EXTERN sbyte4 SSL_connect (TCP_SOCKET tempSocket, ubyte sessionIdLen, ubyte *sessionId, ubyte *masterSecret, const sbyte *dnsName, struct certStore *certStore)
 Create a synchronous client connection context. More...
 
MOC_EXTERN sbyte4 SSL_PROXY_connect (TCP_SOCKET sslSocket, sbyte4 sslId, SSLTransportSend transportSend, SSLTransportRecv transportRecv, TCP_SOCKET tempSocket, ubyte sessionIdLen, ubyte *sessionId, ubyte *masterSecret, const sbyte *dnsName, struct certStore *certStore)
 Create a synchronous client connection context with transport handlers for creating a connection through an existing proxy server connection. More...
 

Detailed Description

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

Function Documentation

◆ SSL_connect()

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

This function creates a connection context for a secure SSL/TLS synchronous connection with a remote 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_CLIENT__

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 synchronous clients only.

ssl.c

◆ SSL_PROXY_connect()

MOC_EXTERN sbyte4 SSL_PROXY_connect ( TCP_SOCKET  sslSocket,
sbyte4  sslId,
SSLTransportSend  transportSend,
SSLTransportRecv  transportRecv,
TCP_SOCKET  tempSocket,
ubyte  sessionIdLen,
ubyte *  sessionId,
ubyte *  masterSecret,
const sbyte *  dnsName,
struct certStore *  certStore 
)

This function creates a connection context for a secure SSL/TLS synchronous connection with a remote server. Transport handlers can be defined for connecting through an existing SSL connection to a proxy 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_CLIENT__

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 synchronous clients only.

ssl.c