Commit 7509e1f8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

tls: add vlc_tls_SocketOpenTLS()

parent 074d8776
......@@ -252,6 +252,14 @@ vlc_tls_t *vlc_tls_SocketOpenAddrInfo(vlc_object_t *obj,
VLC_API vlc_tls_t *vlc_tls_SocketOpenTCP(vlc_object_t *obj,
const char *hostname, unsigned port);
/**
* Initiates a TLS session over TCP.
*/
VLC_API vlc_tls_t *vlc_tls_SocketOpenTLS(vlc_tls_creds_t *crd,
const char *hostname, unsigned port,
const char *service,
const char *const *alpn, char **alp);
VLC_DEPRECATED
static inline vlc_tls_t *
vlc_tls_ClientSessionCreateFD(vlc_tls_creds_t *crd, int fd, const char *host,
......
......@@ -444,6 +444,7 @@ vlc_tls_Write
vlc_tls_GetLine
vlc_tls_SocketOpen
vlc_tls_SocketOpenTCP
vlc_tls_SocketOpenTLS
ToCharset
update_Check
update_Delete
......
......@@ -493,3 +493,18 @@ vlc_tls_t *vlc_tls_SocketOpenTCP(vlc_object_t *obj, const char *name,
freeaddrinfo(res);
return tls;
}
vlc_tls_t *vlc_tls_SocketOpenTLS(vlc_tls_creds_t *creds, const char *name,
unsigned port, const char *service,
const char *const *alpn, char **alp)
{
vlc_tls_t *tcp = vlc_tls_SocketOpenTCP(VLC_OBJECT(creds), name, port);
if (tcp == NULL)
return NULL;
vlc_tls_t *tls = vlc_tls_ClientSessionCreate(creds, tcp, name, service,
alpn, alp);
if (tls == NULL)
vlc_tls_SessionDelete(tcp);
return tls;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment