VLC 4.0.0-dev
No Matches
Collaboration diagram for TLS client:

Data Structures

struct  vlc_tls_client
 TLS client-side credentials. More...
struct  vlc_tls_client_operations


typedef struct vlc_tls_client vlc_tls_client_t
 TLS client-side credentials.


vlc_tls_client_tvlc_tls_ClientCreate (vlc_object_t *)
 Allocates TLS client-side credentials.
void vlc_tls_ClientDelete (vlc_tls_client_t *)
 Releases TLS client-side credentials.
vlc_tls_tvlc_tls_ClientSessionCreate (vlc_tls_client_t *creds, vlc_tls_t *sock, const char *hostname, const char *service, const char *const *alpn, char **alp)
 Initiates a client TLS session.

Detailed Description

Typedef Documentation

◆ vlc_tls_client_t

TLS client-side credentials.

This structure contains the credentials for establishing TLS sessions on client side, essentially the set of trusted root Certificate Authorities with which to validate certificate chains presented by servers.

Function Documentation

◆ vlc_tls_ClientCreate()

vlc_tls_client_t * vlc_tls_ClientCreate ( vlc_object_t obj)

Allocates TLS client-side credentials.

Credentials can be cached and reused across multiple TLS sessions.

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_request().

◆ vlc_tls_ClientDelete()

void vlc_tls_ClientDelete ( vlc_tls_client_t crd)

Releases TLS client-side credentials.

Releases data allocated with vlc_tls_ClientCreate().

References vlc_tls_client_operations::destroy, vlc_tls_client::ops, VLC_OBJECT, vlc_object_delete, and vlc_objres_clear().

Referenced by vlc_http_mgr_destroy().

◆ vlc_tls_ClientSessionCreate()

vlc_tls_t * vlc_tls_ClientSessionCreate ( vlc_tls_client_t creds,
vlc_tls_t sock,
const char *  hostname,
const char *  service,
const char *const *  alpn,
char **  alp 

Initiates a client TLS session.

Initiates a Transport Layer Security (TLS) session as the client side, using trusted root CAs previously loaded with vlc_tls_ClientCreate().

This is a blocking network operation and may be a thread cancellation point.

credsX.509 credentials, i.e. set of root certificates of trusted certificate authorities
socksocket through which to establish the secure channel
hostnameexpected server name, used both as Server Name Indication and as expected Common Name of the peer certificate [IN]
serviceunique identifier for the service to connect to (only used locally for certificates database) [IN]
alpnNULL-terminated list of Application Layer Protocols to negotiate, or NULL to not negotiate protocols [IN]
alpstorage space for the negotiated Application Layer Protocol or NULL if negotiation was not performed [OUT]
The credentials must remain valid until the session is finished.
TLS session, or NULL on error.

References cleanup_tls(), pollfd::events, pollfd::fd, vlc_tls_client_operations::handshake, MS_FROM_VLC_TICK, msg_Err, vlc_tls_client_operations::open, vlc_tls_client::ops, vlc_tls::p, POLLIN, POLLOUT, var_InheritInteger(), vlc_cleanup_pop, vlc_cleanup_push, vlc_killed(), vlc_poll_i11e(), vlc_restorecancel(), vlc_savecancel(), VLC_TICK_FROM_MS, vlc_tick_now(), vlc_tls_GetPollFD(), and vlc_tls_SessionDelete().

Referenced by vlc_https_connect_proxy(), and vlc_tls_SocketOpenTLS().