VLC  4.0.0-dev
Data Structures | Typedefs | Functions
Collaboration diagram for TLS server:

Data Structures

struct  vlc_tls_server
 TLS server-side credentials. More...
struct  vlc_tls_server_operations


typedef struct vlc_tls_server vlc_tls_server_t
 TLS server-side credentials. More...


vlc_tls_server_tvlc_tls_ServerCreate (vlc_object_t *, const char *cert, const char *key)
 Allocates server TLS credentials. More...
static int vlc_tls_SessionHandshake (vlc_tls_server_t *crd, vlc_tls_t *tls)
vlc_tls_tvlc_tls_ServerSessionCreate (vlc_tls_server_t *creds, vlc_tls_t *sock, const char *const *alpn)
 Creates a TLS server session. More...
void vlc_tls_ServerDelete (vlc_tls_server_t *)
 Releases server-side TLS credentials. More...

Detailed Description

Typedef Documentation

◆ vlc_tls_server_t

TLS server-side credentials.

This structure contains the credentials for establishing TLS sessions. This includes root Certificate Authorities (on client side), trust and cryptographic parameters, public certificates and private keys.

Function Documentation

◆ vlc_tls_ServerCreate()

vlc_tls_server_t* vlc_tls_ServerCreate ( vlc_object_t ,
const char *  cert,
const char *  key 

Allocates server TLS credentials.

certpath to an x509 certificate (required)
keypath to the PKCS private key for the certificate, or NULL to use cert path
TLS credentials object, or NULL on error.

References msg_Err, tls_server_load(), unlikely, vlc_custom_create, vlc_module_load, and vlc_object_delete.

Referenced by vlc_https_HostNew().

◆ vlc_tls_ServerDelete()

void vlc_tls_ServerDelete ( vlc_tls_server_t )

◆ vlc_tls_ServerSessionCreate()

vlc_tls_t* vlc_tls_ServerSessionCreate ( vlc_tls_server_t creds,
vlc_tls_t sock,
const char *const *  alpn 

Creates a TLS server session.

Allocates a Transport Layer Security (TLS) session as the server side, using cryptographic keys pair and X.509 certificates chain already loaded with vlc_tls_ServerCreate().

Unlike vlc_tls_ClientSessionCreate(), this function does not perform any actual network I/O. vlc_tls_SessionHandshake() must be used to perform the TLS handshake before sending and receiving data through the TLS session.

This function is non-blocking and is not a cancellation point.

credsserver credentials, i.e. keys pair and X.509 certificates chain
alpnNULL-terminated list of Application Layer Protocols to negotiate, or NULL to not negotiate protocols
TLS session, or NULL on error.

References vlc_tls_server_operations::open, vlc_tls_server::ops, vlc_tls::p, vlc_restorecancel(), and vlc_savecancel().

Referenced by httpdLoop(), and vlc_tls_SessionHandshake().

◆ vlc_tls_SessionHandshake()

static int vlc_tls_SessionHandshake ( vlc_tls_server_t crd,
vlc_tls_t tls