### APIDOC: Start SSL Client Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Handles the entire process of starting an SSL client, including TCP connection initiation, random number generation seeding, SSL/TLS defaults setup, authentication, and SSL handshake. ```APIDOC start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey) ``` -------------------------------- ### Install SSLClient Library for Testing Source: https://github.com/govorox/sslclient/blob/master/scripts/README.md This script automates the process of cloning, preparing, and installing the `SSLClient` library from a specified branch of the repository for use with the Arduino CLI. It requires `git`, `bash`, and `arduino-cli` to be installed and configured. ```bash ./scripts/install_sslclient_for_testing.sh [--branch ] ``` -------------------------------- ### Install SSLClient Library via PlatformIO Source: https://github.com/govorox/sslclient/blob/master/README.md Instructions to add the SSLClient library as a dependency in a PlatformIO project's platformio.ini file, specifying the library and its version constraint. ```PlatformIO INI lib_deps = digitaldragon/SSLClient@^1.3.1 ``` -------------------------------- ### Manage PlatformIO Libraries and Platforms with CLI Source: https://github.com/govorox/sslclient/blob/master/scripts/README.md This script provides a convenient, menu-driven way to manage libraries, platforms, and frameworks using the PlatformIO CLI. It also allows switching between different versions of the Arduino-ESP32 core. Requires `bash` and `platformio-cli` (pio) to be installed. ```bash ./scripts/platformio_cli_utility.sh ``` -------------------------------- ### Manage Arduino Libraries and Platforms with CLI Source: https://github.com/govorox/sslclient/blob/master/scripts/README.md This script provides a convenient, menu-driven way to manage Arduino libraries, platforms, and frameworks using the Arduino CLI. It also allows switching between different versions of the ESP32-Arduino core. Ensure `arduino-cli` is installed and properly configured before running. ```bash ./scripts/arduino_cli_utility.sh ``` -------------------------------- ### APIDOC: Set Up SSL/TLS Defaults Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Sets up SSL/TLS configuration with default settings. ```APIDOC set_up_tls_defaults(sslclient_context *ssl_client) ``` -------------------------------- ### APIDOC: Initialize SSL Context Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Initializes the SSL context with default values and sets up necessary SSL configurations. ```APIDOC ssl_init(sslclient_context *ssl_client, Client *client) ``` -------------------------------- ### Initialize SSLClient for Basic Connection in C++ Source: https://github.com/govorox/sslclient/blob/master/README.md Demonstrates how to initialize the SSLClient library by providing a transport layer, which must inherit from the Arduino Client class. This sets up the basic secure client instance. ```cpp #include // Initialize your transport layer (e.g., WiFi, GSM) // A Client is anything which inherits from the Arduino Client class. Client transport = /* Your transport layer */; // Create SSLClient instance SSLClient sslClient(&transport); // Your setup code here... ``` -------------------------------- ### Connect to AWS IoT MQTT Broker using SSLClient in C++ Source: https://github.com/govorox/sslclient/blob/master/README.md Illustrates how to establish a secure connection to an AWS IoT MQTT broker using SSLClient. This involves setting up CA, client certificate, and private key, then initializing an MQTT client with the secure SSLClient instance. ```cpp TinyGsmClient transport(modem); SSLClient secure(&transport); // Set up certificates secure.setCACert(AWS_CERT_CA); secure.setCertificate(AWS_CERT_CRT); secure.setPrivateKey(AWS_CERT_PRIVATE); // Connect to MQTT broker on AWS endpoint MQTTClient mqtt = MQTTClient(256); mqtt.begin(AWS_IOT_ENDPOINT, 8883, secure); ``` -------------------------------- ### APIDOC: Load Client Certificate and Key Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Loads and initializes the client's certificate and private key for SSL/TLS authentication. ```APIDOC auth_client_cert_key(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key, bool *client_cert_initialized, bool *client_key_initialized) ``` -------------------------------- ### APIDOC: Initialize TCP Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Initializes a TCP connection to a remote host. ```APIDOC init_tcp_connection(sslclient_context *ssl_client, const char *host, uint32_t port) ``` -------------------------------- ### APIDOC: Configure Root CA or PSK Authentication Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Configures SSL/TLS authentication options based on provided CA certificates or pre-shared keys. ```APIDOC auth_root_ca_buff(sslclient_context *ssl_client, const char *rootCABuff, bool *ca_cert_initialized, const char *pskIdent, const char *psKey) ``` -------------------------------- ### APIDOC: Verify Server Certificate Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Verifies the server's certificate against the provided root CA. ```APIDOC verify_server_cert(sslclient_context *ssl_client) ``` -------------------------------- ### APIDOC: Match Certificate Name to Domain Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Compares a name from a certificate to a domain name to check if they match. ```APIDOC match_name(const string& name, const string& domainName) ``` -------------------------------- ### APIDOC: Send Data over SSL Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Sends data over an SSL connection. Ensures the client is properly initialized and connected before sending data. ```APIDOC client_net_send(void *ctx, const unsigned char *buf, size_t len) ``` -------------------------------- ### APIDOC: Check for Data to Read Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Checks if there is data available to read from the SSL connection. ```APIDOC data_to_read(sslclient_context *ssl_client) ``` -------------------------------- ### APIDOC: Perform SSL/TLS Handshake Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Manages the SSL/TLS handshake process. ```APIDOC perform_ssl_handshake(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key) ``` -------------------------------- ### APIDOC: Seed Random Number Generator for SSL/TLS Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Seeds the random number generator critical for SSL/TLS operations. ```APIDOC seed_random_number_generator(sslclient_context *ssl_client) ``` -------------------------------- ### CSQ / RSSI / Signal Strength Reference Table Source: https://github.com/govorox/sslclient/blob/master/docs/RSSI.md Provides a detailed mapping of CSQ (Signal Quality) values to corresponding RSSI (Received Signal Strength Indicator) ranges in dBm, and a qualitative description of the signal strength. This table is crucial for understanding and troubleshooting cellular modem connectivity. ```APIDOC CSQ Value | RSSI (dBm) | Description ----------|---------------------|------------------ 0 | -113 dBm or less | No signal 1-2 | -111 dBm to -109 dBm| Very poor signal 3-9 | -107 dBm to -93 dBm | Poor signal 10-14 | -91 dBm to -83 dBm | Fair signal 15-19 | -81 dBm to -73 dBm | Good signal 20-30 | -71 dBm to -53 dBm | Very good signal 31 | -51 dBm or more | Excellent signal ``` -------------------------------- ### APIDOC: Parse Hexadecimal Nibble Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Parses a hexadecimal nibble into its binary representation. ```APIDOC parse_hex_nibble(char pb, uint8_t* res) ``` -------------------------------- ### APIDOC: Internal Error Handling Function Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Handles internal errors by interpreting error codes from SSL operations and logging them for debugging. ```APIDOC _handle_error(int err, const char* function, int line) ``` -------------------------------- ### APIDOC: Verify SSL Certificate Domain Name Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Checks if the peer certificate contains the specified domain name in its Common Name (CN) or Subject Alternative Names (SANs). ```APIDOC verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name) ``` -------------------------------- ### APIDOC: Verify SSL Certificate Fingerprint Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Verifies the certificate provided by the peer against a specified SHA256 fingerprint. ```APIDOC verify_ssl_fingerprint(sslclient_context *ssl_client, const char* fp, const char* domain_name) ``` -------------------------------- ### APIDOC: Receive Data from SSL Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Receives data from the SSL connection. ```APIDOC get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, size_t length) ``` -------------------------------- ### APIDOC: Set Hostname for TLS Session Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Sets the hostname for the TLS session, which should match the Common Name (CN) in the server's certificate. ```APIDOC set_hostname_for_tls(sslclient_context *ssl_client, const char *host) ``` -------------------------------- ### APIDOC: Cleanup SSL Resources Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Frees allocated resources and stops the SSL socket if an error occurred during SSL operations. ```APIDOC cleanup(sslclient_context *ssl_client, bool ca_cert_initialized, bool client_cert_initialized, bool client_key_initialized, int ret, const char *rootCABuff, const char *cli_cert, const char *cli_key) ``` -------------------------------- ### APIDOC: Send Data over SSL Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Sends data over an established SSL connection. ```APIDOC send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, size_t len) ``` -------------------------------- ### APIDOC: Receive Data over SSL Connection Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Receives data over an established SSL connection. Checks for a valid client context and returns the number of bytes received or an error code. ```APIDOC client_net_recv(void *ctx, unsigned char *buf, size_t len) ``` -------------------------------- ### APIDOC: Receive Data with Timeout over SSL Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Receives data over an established SSL connection with an additional timeout parameter. Useful for non-blocking operations. ```APIDOC client_net_recv_timeout(void *ctx, unsigned char *buf, size_t len, uint32_t timeout) ``` -------------------------------- ### APIDOC: stop_ssl_socket Function Source: https://github.com/govorox/sslclient/blob/master/docs/FUNCTIONS.md Documents the `stop_ssl_socket` function, which is responsible for terminating an SSL socket connection and releasing all associated memory and resources within the SSLClient library. ```APIDOC stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key) Description: Stops the SSL socket and frees associated resources. Parameters: ssl_client: Pointer to the SSL client context. rootCABuff: Pointer to the root CA certificate buffer. cli_cert: Pointer to the client certificate buffer. cli_key: Pointer to the client key buffer. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.