Functions | |
void | ltrx_ssl_client_close (uint32_t sslSessionIdentifier) |
Close the SSL layer. More... | |
bool | ltrx_ssl_client_connect (struct ltrx_ip_socket *ipSocket, uint32_t *sslSessionIdentifier) |
Open an SSL connection. More... | |
bool | ltrx_ssl_client_receive (uint32_t sslSessionIdentifier, void *buffer, size_t bufferLength, size_t *bytesReceived, uint32_t blockTimeMsec) |
Receive data. More... | |
bool | ltrx_ssl_client_send (uint32_t sslSessionIdentifier, const void *data, size_t length) |
Send the specified bytes of data. More... | |
SSL Client is compliant with SSLv3, TLS 1.0, TLS 1.1, and TLS 1.2. Due to severe memory limitations, only a single connection instance is provided.
To use this API, follow these steps:
(1) Include the header file:
#include "ssl_client_module_libs.h"
(2) Declare the global pointer:
const struct ssl_client_external_functions *
g_ssl_clientExternalFunctionEntry_pointer = 0;
(3) Initialize the pointer in your _module_startup
routine:
void <your_module>_module_startup(void)
{
g_ssl_clientExternalFunctionEntry_pointer =
ltrx_module_functions_lookup("ssl_client");
// Your module startup goes here.
}
void ltrx_ssl_client_close | ( | uint32_t | sslSessionIdentifier | ) |
Close the SSL layer.
This function blocks until completed. After this call, you must still close the TCP socket connection that was originally passed in to ltrx_ssl_client_connect().
[in] | sslSessionIdentifier | Session identifier from your earlier call to ltrx_ssl_client_connect(). |
bool ltrx_ssl_client_connect | ( | struct ltrx_ip_socket * | ipSocket, |
uint32_t * | sslSessionIdentifier | ||
) |
Open an SSL connection.
First you must establish a TCP connection to the desired SSL Server; see the documentation for ltrx_tcp_connect().
true | Successful. |
false | Failed. |
[in] | ipSocket | Socket for the TCP connection already established. |
[out] | sslSessionIdentifier | Session identifier to be used with subsequent API calls. |
bool ltrx_ssl_client_receive | ( | uint32_t | sslSessionIdentifier, |
void * | buffer, | ||
size_t | bufferLength, | ||
size_t * | bytesReceived, | ||
uint32_t | blockTimeMsec | ||
) |
Receive data.
This function blocks until the timeout expires or at least one byte was received.
true | Success; see bytesReceived . |
false | Failure; either bad parameters or the connection was lost. |
[in] | sslSessionIdentifier | Session identifier from your earlier call to ltrx_ssl_client_connect(). |
[out] | buffer | Points to buffer that will receive data. |
[in] | bufferLength | Maximum number of bytes that buffer may hold; must be at least one. |
[out] | bytesReceived | The number of bytes that were copied to buffer ; possibly zero. |
[in] | blockTimeMsec | Maximum time to wait in milliseconds. |
bool ltrx_ssl_client_send | ( | uint32_t | sslSessionIdentifier, |
const void * | data, | ||
size_t | length | ||
) |
Send the specified bytes of data.
This function blocks until completed.
true | All of the data was sent. |
false | The connection was lost. |
[in] | sslSessionIdentifier | Session identifier from your earlier call to ltrx_ssl_client_connect(). |
[in] | data | Points to the data to be sent. |
[in] | length | Specifies how many bytes are to be sent. |