VLC 4.0.0-dev
Collaboration diagram for TLS server:

Data Structures

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

Typedefs

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

Functions

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 obj,
const char *  cert,
const char *  key 
)

Allocates server TLS credentials.

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

References vlc_object_t::logger, msg_Err, unlikely, vlc_custom_create, vlc_module_map(), vlc_module_match(), VLC_OBJECT, vlc_object_delete, vlc_objres_clear(), and VLC_SUCCESS.

Referenced by vlc_https_HostNew().

◆ vlc_tls_ServerDelete()

void vlc_tls_ServerDelete ( vlc_tls_server_t crd)

Releases server-side TLS credentials.

Releases data allocated with vlc_tls_ServerCreate().

References vlc_tls_server_operations::destroy, vlc_tls_server::ops, VLC_OBJECT, vlc_object_delete, and vlc_objres_clear().

Referenced by httpd_HostCreate(), and httpd_HostDelete().

◆ 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.

Parameters
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
Returns
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().

◆ vlc_tls_SessionHandshake()

static int vlc_tls_SessionHandshake ( vlc_tls_server_t crd,
vlc_tls_t tls 
)
inlinestatic