Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

TLS

ytls.h

The ytls.h header file defines the interface for the TLS (Transport Layer Security) functionality in the Yuneta framework. It provides function declarations and structures for handling secure communication using TLS. Key features include:

Architecture

The ytls module uses a backend-agnostic design. The public API (ytls.h / ytls.c) exposes a single api_tls_t dispatch table, while the actual crypto is provided by one of two interchangeable backends selected at compile time via Kconfig:

The compile-time macro TLS_LIBRARY_NAME (defined in ytls.h) expands to "openssl" or "mbedtls" accordingly.

At runtime, the chosen backend is available as the yuno global variable __tls_library__ (set in gobj.c). This allows any GObj in the tree to query which TLS backend the yuno was compiled with — for example, to adapt configuration strings or log the active backend at startup.

Source files

FilePurpose
ytls.h / ytls.cPublic API and dispatch table
tls/openssl.c / openssl.hOpenSSL backend implementation
tls/mbedtls.c / mbedtls.hmbed-TLS backend implementation

Backend implementations

Both backends implement the same functionality:

This module ensures that Yuneta applications can securely transmit data over the network using industry-standard encryption protocols.

Philosophy of ytls

The ytls module is built with the core philosophy of Yuneta in mind:

By following these principles, ytls ensures that Yuneta-based applications maintain strong security without unnecessary complexity.