2015-05-27 12:57:50 +02:00
|
|
|
/*
|
|
|
|
|
* TLS/SSL Protocol
|
|
|
|
|
* Copyright (c) 2011 Martin Storsjo
|
|
|
|
|
*
|
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
|
*
|
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
2015-05-27 12:57:51 +02:00
|
|
|
#include <errno.h>
|
|
|
|
|
|
2015-05-27 12:57:50 +02:00
|
|
|
#include <gnutls/gnutls.h>
|
2025-09-08 16:08:22 +08:00
|
|
|
#include <gnutls/dtls.h>
|
2015-05-27 12:57:50 +02:00
|
|
|
#include <gnutls/x509.h>
|
|
|
|
|
|
|
|
|
|
#include "avformat.h"
|
|
|
|
|
#include "network.h"
|
|
|
|
|
#include "os_support.h"
|
|
|
|
|
#include "url.h"
|
|
|
|
|
#include "tls.h"
|
|
|
|
|
#include "libavutil/opt.h"
|
2024-05-17 14:53:33 +02:00
|
|
|
#include "libavutil/thread.h"
|
2015-05-27 12:57:50 +02:00
|
|
|
|
2017-09-26 13:25:54 +02:00
|
|
|
#ifndef GNUTLS_VERSION_NUMBER
|
|
|
|
|
#define GNUTLS_VERSION_NUMBER LIBGNUTLS_VERSION_NUMBER
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-05-27 12:57:51 +02:00
|
|
|
#if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
|
|
|
|
|
#include <gcrypt.h>
|
|
|
|
|
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-05-27 12:57:50 +02:00
|
|
|
typedef struct TLSContext {
|
|
|
|
|
TLSShared tls_shared;
|
|
|
|
|
gnutls_session_t session;
|
|
|
|
|
gnutls_certificate_credentials_t cred;
|
|
|
|
|
int need_shutdown;
|
2021-03-26 15:41:07 +02:00
|
|
|
int io_err;
|
2015-05-27 12:57:50 +02:00
|
|
|
} TLSContext;
|
|
|
|
|
|
2024-05-17 14:53:33 +02:00
|
|
|
static AVMutex gnutls_mutex = AV_MUTEX_INITIALIZER;
|
|
|
|
|
|
2015-05-27 12:57:51 +02:00
|
|
|
void ff_gnutls_init(void)
|
|
|
|
|
{
|
2024-05-17 14:53:33 +02:00
|
|
|
ff_mutex_lock(&gnutls_mutex);
|
2015-05-27 12:57:51 +02:00
|
|
|
#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
|
|
|
|
|
if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
|
|
|
|
|
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
|
|
|
|
#endif
|
|
|
|
|
gnutls_global_init();
|
2024-05-17 14:53:33 +02:00
|
|
|
ff_mutex_unlock(&gnutls_mutex);
|
2015-05-27 12:57:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ff_gnutls_deinit(void)
|
|
|
|
|
{
|
2024-05-17 14:53:33 +02:00
|
|
|
ff_mutex_lock(&gnutls_mutex);
|
2015-05-27 12:57:51 +02:00
|
|
|
gnutls_global_deinit();
|
2024-05-17 14:53:33 +02:00
|
|
|
ff_mutex_unlock(&gnutls_mutex);
|
2015-05-27 12:57:51 +02:00
|
|
|
}
|
|
|
|
|
|
2015-05-27 12:57:50 +02:00
|
|
|
static int print_tls_error(URLContext *h, int ret)
|
|
|
|
|
{
|
2021-03-26 15:41:07 +02:00
|
|
|
TLSContext *c = h->priv_data;
|
2015-05-27 12:57:50 +02:00
|
|
|
switch (ret) {
|
|
|
|
|
case GNUTLS_E_AGAIN:
|
2017-06-19 15:49:25 +03:00
|
|
|
return AVERROR(EAGAIN);
|
2015-05-27 12:57:50 +02:00
|
|
|
case GNUTLS_E_INTERRUPTED:
|
2017-09-26 13:25:53 +02:00
|
|
|
#ifdef GNUTLS_E_PREMATURE_TERMINATION
|
2017-09-15 17:04:38 +09:00
|
|
|
case GNUTLS_E_PREMATURE_TERMINATION:
|
2017-09-26 13:25:53 +02:00
|
|
|
#endif
|
2015-05-27 12:57:50 +02:00
|
|
|
break;
|
|
|
|
|
case GNUTLS_E_WARNING_ALERT_RECEIVED:
|
|
|
|
|
av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
av_log(h, AV_LOG_ERROR, "%s\n", gnutls_strerror(ret));
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-03-26 15:41:07 +02:00
|
|
|
if (c->io_err) {
|
|
|
|
|
av_log(h, AV_LOG_ERROR, "IO error: %s\n", av_err2str(c->io_err));
|
|
|
|
|
ret = c->io_err;
|
|
|
|
|
c->io_err = 0;
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2015-05-27 12:57:50 +02:00
|
|
|
return AVERROR(EIO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int tls_close(URLContext *h)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *c = h->priv_data;
|
2025-09-08 16:08:22 +08:00
|
|
|
TLSShared *s = &c->tls_shared;
|
2015-05-27 12:57:50 +02:00
|
|
|
if (c->need_shutdown)
|
2015-06-13 23:55:21 +02:00
|
|
|
gnutls_bye(c->session, GNUTLS_SHUT_WR);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (c->session)
|
|
|
|
|
gnutls_deinit(c->session);
|
|
|
|
|
if (c->cred)
|
|
|
|
|
gnutls_certificate_free_credentials(c->cred);
|
2025-09-08 16:08:22 +08:00
|
|
|
if (!s->external_sock)
|
|
|
|
|
ffurl_closep(s->is_dtls ? &s->udp : &s->tcp);
|
2015-05-27 12:57:51 +02:00
|
|
|
ff_gnutls_deinit();
|
2015-05-27 12:57:50 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ssize_t gnutls_url_pull(gnutls_transport_ptr_t transport,
|
|
|
|
|
void *buf, size_t len)
|
|
|
|
|
{
|
2021-03-26 15:41:07 +02:00
|
|
|
TLSContext *c = (TLSContext*) transport;
|
|
|
|
|
int ret = ffurl_read(c->tls_shared.tcp, buf, len);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (ret >= 0)
|
|
|
|
|
return ret;
|
|
|
|
|
if (ret == AVERROR_EXIT)
|
|
|
|
|
return 0;
|
2021-03-26 15:41:07 +02:00
|
|
|
if (ret == AVERROR(EAGAIN)) {
|
2017-06-19 15:49:25 +03:00
|
|
|
errno = EAGAIN;
|
2021-03-26 15:41:07 +02:00
|
|
|
} else {
|
2017-06-19 15:49:25 +03:00
|
|
|
errno = EIO;
|
2021-03-26 15:41:07 +02:00
|
|
|
c->io_err = ret;
|
|
|
|
|
}
|
2015-05-27 12:57:50 +02:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ssize_t gnutls_url_push(gnutls_transport_ptr_t transport,
|
|
|
|
|
const void *buf, size_t len)
|
|
|
|
|
{
|
2021-03-26 15:41:07 +02:00
|
|
|
TLSContext *c = (TLSContext*) transport;
|
|
|
|
|
int ret = ffurl_write(c->tls_shared.tcp, buf, len);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (ret >= 0)
|
|
|
|
|
return ret;
|
|
|
|
|
if (ret == AVERROR_EXIT)
|
|
|
|
|
return 0;
|
2021-03-26 15:41:07 +02:00
|
|
|
if (ret == AVERROR(EAGAIN)) {
|
2017-06-19 15:49:25 +03:00
|
|
|
errno = EAGAIN;
|
2021-03-26 15:41:07 +02:00
|
|
|
} else {
|
2017-06-19 15:49:25 +03:00
|
|
|
errno = EIO;
|
2021-03-26 15:41:07 +02:00
|
|
|
c->io_err = ret;
|
|
|
|
|
}
|
2015-05-27 12:57:50 +02:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
|
|
|
|
|
{
|
2025-08-16 19:31:33 +08:00
|
|
|
TLSContext *c = h->priv_data;
|
|
|
|
|
TLSShared *s = &c->tls_shared;
|
2025-09-08 16:08:22 +08:00
|
|
|
uint16_t gnutls_flags = 0;
|
2015-05-27 12:57:50 +02:00
|
|
|
int ret;
|
|
|
|
|
|
2015-05-27 12:57:51 +02:00
|
|
|
ff_gnutls_init();
|
2015-05-27 12:57:50 +02:00
|
|
|
|
2025-08-16 19:31:33 +08:00
|
|
|
if ((ret = ff_tls_open_underlying(s, h, uri, options)) < 0)
|
2015-05-27 12:57:50 +02:00
|
|
|
goto fail;
|
|
|
|
|
|
2025-09-08 16:08:22 +08:00
|
|
|
if (s->is_dtls)
|
|
|
|
|
gnutls_flags |= GNUTLS_DATAGRAM;
|
|
|
|
|
|
|
|
|
|
if (s->listen)
|
|
|
|
|
gnutls_flags |= GNUTLS_SERVER;
|
|
|
|
|
else
|
|
|
|
|
gnutls_flags |= GNUTLS_CLIENT;
|
|
|
|
|
gnutls_init(&c->session, gnutls_flags);
|
2025-08-16 19:31:33 +08:00
|
|
|
if (!s->listen && !s->numerichost)
|
|
|
|
|
gnutls_server_name_set(c->session, GNUTLS_NAME_DNS, s->host, strlen(s->host));
|
|
|
|
|
gnutls_certificate_allocate_credentials(&c->cred);
|
|
|
|
|
if (s->ca_file) {
|
|
|
|
|
ret = gnutls_certificate_set_x509_trust_file(c->cred, s->ca_file, GNUTLS_X509_FMT_PEM);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (ret < 0)
|
|
|
|
|
av_log(h, AV_LOG_ERROR, "%s\n", gnutls_strerror(ret));
|
|
|
|
|
}
|
2015-08-12 20:06:22 -04:00
|
|
|
#if GNUTLS_VERSION_NUMBER >= 0x030020
|
2015-05-27 12:57:50 +02:00
|
|
|
else
|
2025-08-16 19:31:33 +08:00
|
|
|
gnutls_certificate_set_x509_system_trust(c->cred);
|
2015-05-27 12:57:50 +02:00
|
|
|
#endif
|
2025-08-16 19:31:33 +08:00
|
|
|
gnutls_certificate_set_verify_flags(c->cred, s->verify ?
|
2015-05-27 12:57:50 +02:00
|
|
|
GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT : 0);
|
2025-08-16 19:31:33 +08:00
|
|
|
if (s->cert_file && s->key_file) {
|
|
|
|
|
ret = gnutls_certificate_set_x509_key_file(c->cred,
|
|
|
|
|
s->cert_file, s->key_file,
|
2015-05-27 12:57:50 +02:00
|
|
|
GNUTLS_X509_FMT_PEM);
|
|
|
|
|
if (ret < 0) {
|
|
|
|
|
av_log(h, AV_LOG_ERROR,
|
|
|
|
|
"Unable to set cert/key files %s and %s: %s\n",
|
2025-08-16 19:31:33 +08:00
|
|
|
s->cert_file, s->key_file, gnutls_strerror(ret));
|
2015-05-27 12:57:50 +02:00
|
|
|
ret = AVERROR(EIO);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2025-08-16 19:31:33 +08:00
|
|
|
} else if (s->cert_file || s->key_file)
|
2015-05-27 12:57:50 +02:00
|
|
|
av_log(h, AV_LOG_ERROR, "cert and key required\n");
|
2025-08-16 19:31:33 +08:00
|
|
|
gnutls_credentials_set(c->session, GNUTLS_CRD_CERTIFICATE, c->cred);
|
|
|
|
|
gnutls_transport_set_pull_function(c->session, gnutls_url_pull);
|
|
|
|
|
gnutls_transport_set_push_function(c->session, gnutls_url_push);
|
|
|
|
|
gnutls_transport_set_ptr(c->session, c);
|
2025-09-08 16:08:22 +08:00
|
|
|
if (s->is_dtls)
|
|
|
|
|
if (s->mtu)
|
|
|
|
|
gnutls_dtls_set_mtu(c->session, s->mtu);
|
2025-08-16 19:31:33 +08:00
|
|
|
gnutls_set_default_priority(c->session);
|
2019-03-27 13:03:07 +01:00
|
|
|
do {
|
2019-08-16 10:38:46 +02:00
|
|
|
if (ff_check_interrupt(&h->interrupt_callback)) {
|
|
|
|
|
ret = AVERROR_EXIT;
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-16 19:31:33 +08:00
|
|
|
ret = gnutls_handshake(c->session);
|
2019-03-27 13:03:07 +01:00
|
|
|
if (gnutls_error_is_fatal(ret)) {
|
|
|
|
|
ret = print_tls_error(h, ret);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
} while (ret);
|
2025-08-16 19:31:33 +08:00
|
|
|
c->need_shutdown = 1;
|
|
|
|
|
if (s->verify) {
|
2015-05-27 12:57:50 +02:00
|
|
|
unsigned int status, cert_list_size;
|
|
|
|
|
gnutls_x509_crt_t cert;
|
|
|
|
|
const gnutls_datum_t *cert_list;
|
2025-08-16 19:31:33 +08:00
|
|
|
if ((ret = gnutls_certificate_verify_peers2(c->session, &status)) < 0) {
|
2015-05-27 12:57:50 +02:00
|
|
|
av_log(h, AV_LOG_ERROR, "Unable to verify peer certificate: %s\n",
|
|
|
|
|
gnutls_strerror(ret));
|
|
|
|
|
ret = AVERROR(EIO);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
if (status & GNUTLS_CERT_INVALID) {
|
|
|
|
|
av_log(h, AV_LOG_ERROR, "Peer certificate failed verification\n");
|
|
|
|
|
ret = AVERROR(EIO);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2025-08-16 19:31:33 +08:00
|
|
|
if (gnutls_certificate_type_get(c->session) != GNUTLS_CRT_X509) {
|
2015-05-27 12:57:50 +02:00
|
|
|
av_log(h, AV_LOG_ERROR, "Unsupported certificate type\n");
|
|
|
|
|
ret = AVERROR(EIO);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
gnutls_x509_crt_init(&cert);
|
2025-08-16 19:31:33 +08:00
|
|
|
cert_list = gnutls_certificate_get_peers(c->session, &cert_list_size);
|
2015-05-27 12:57:50 +02:00
|
|
|
gnutls_x509_crt_import(cert, cert_list, GNUTLS_X509_FMT_DER);
|
2025-08-16 19:31:33 +08:00
|
|
|
ret = gnutls_x509_crt_check_hostname(cert, s->host);
|
2015-05-27 12:57:50 +02:00
|
|
|
gnutls_x509_crt_deinit(cert);
|
|
|
|
|
if (!ret) {
|
|
|
|
|
av_log(h, AV_LOG_ERROR,
|
2025-08-16 19:31:33 +08:00
|
|
|
"The certificate's owner does not match hostname %s\n", s->host);
|
2015-05-27 12:57:50 +02:00
|
|
|
ret = AVERROR(EIO);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
fail:
|
|
|
|
|
tls_close(h);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-08 16:08:22 +08:00
|
|
|
static int dtls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *c = h->priv_data;
|
|
|
|
|
TLSShared *s = &c->tls_shared;
|
|
|
|
|
s->is_dtls = 1;
|
|
|
|
|
return tls_open(h, uri, flags, options);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-27 12:57:50 +02:00
|
|
|
static int tls_read(URLContext *h, uint8_t *buf, int size)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *c = h->priv_data;
|
2025-09-08 16:08:22 +08:00
|
|
|
TLSShared *s = &c->tls_shared;
|
|
|
|
|
URLContext *uc = s->is_dtls ? s->udp : s->tcp;
|
2017-06-19 15:49:25 +03:00
|
|
|
int ret;
|
|
|
|
|
// Set or clear the AVIO_FLAG_NONBLOCK on c->tls_shared.tcp
|
2025-09-08 16:08:22 +08:00
|
|
|
uc->flags &= ~AVIO_FLAG_NONBLOCK;
|
|
|
|
|
uc->flags |= h->flags & AVIO_FLAG_NONBLOCK;
|
2017-06-19 15:49:25 +03:00
|
|
|
ret = gnutls_record_recv(c->session, buf, size);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (ret > 0)
|
|
|
|
|
return ret;
|
|
|
|
|
if (ret == 0)
|
|
|
|
|
return AVERROR_EOF;
|
|
|
|
|
return print_tls_error(h, ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int tls_write(URLContext *h, const uint8_t *buf, int size)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *c = h->priv_data;
|
2025-09-08 16:08:22 +08:00
|
|
|
TLSShared *s = &c->tls_shared;
|
|
|
|
|
URLContext *uc = s->is_dtls ? s->udp : s->tcp;
|
2017-06-19 15:49:25 +03:00
|
|
|
int ret;
|
|
|
|
|
// Set or clear the AVIO_FLAG_NONBLOCK on c->tls_shared.tcp
|
2025-09-08 16:08:22 +08:00
|
|
|
uc->flags &= ~AVIO_FLAG_NONBLOCK;
|
|
|
|
|
uc->flags |= h->flags & AVIO_FLAG_NONBLOCK;
|
2017-06-19 15:49:25 +03:00
|
|
|
ret = gnutls_record_send(c->session, buf, size);
|
2015-05-27 12:57:50 +02:00
|
|
|
if (ret > 0)
|
|
|
|
|
return ret;
|
|
|
|
|
if (ret == 0)
|
|
|
|
|
return AVERROR_EOF;
|
|
|
|
|
return print_tls_error(h, ret);
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-16 10:28:21 -04:00
|
|
|
static int tls_get_file_handle(URLContext *h)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *c = h->priv_data;
|
|
|
|
|
return ffurl_get_file_handle(c->tls_shared.tcp);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-29 21:56:17 +02:00
|
|
|
static int tls_get_short_seek(URLContext *h)
|
|
|
|
|
{
|
|
|
|
|
TLSContext *s = h->priv_data;
|
|
|
|
|
return ffurl_get_short_seek(s->tls_shared.tcp);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-27 12:57:50 +02:00
|
|
|
static const AVOption options[] = {
|
|
|
|
|
TLS_COMMON_OPTIONS(TLSContext, tls_shared),
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const AVClass tls_class = {
|
|
|
|
|
.class_name = "tls",
|
2024-01-19 13:33:28 +01:00
|
|
|
.item_name = av_default_item_name,
|
2015-05-27 12:57:50 +02:00
|
|
|
.option = options,
|
|
|
|
|
.version = LIBAVUTIL_VERSION_INT,
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-23 10:15:28 +02:00
|
|
|
const URLProtocol ff_tls_protocol = {
|
2015-05-27 12:57:50 +02:00
|
|
|
.name = "tls",
|
|
|
|
|
.url_open2 = tls_open,
|
|
|
|
|
.url_read = tls_read,
|
|
|
|
|
.url_write = tls_write,
|
|
|
|
|
.url_close = tls_close,
|
2016-10-16 10:28:21 -04:00
|
|
|
.url_get_file_handle = tls_get_file_handle,
|
2020-10-29 21:56:17 +02:00
|
|
|
.url_get_short_seek = tls_get_short_seek,
|
2015-05-27 12:57:50 +02:00
|
|
|
.priv_data_size = sizeof(TLSContext),
|
|
|
|
|
.flags = URL_PROTOCOL_FLAG_NETWORK,
|
|
|
|
|
.priv_data_class = &tls_class,
|
|
|
|
|
};
|
2025-09-08 16:08:22 +08:00
|
|
|
|
|
|
|
|
static const AVClass dtls_class = {
|
|
|
|
|
.class_name = "dtls",
|
|
|
|
|
.item_name = av_default_item_name,
|
|
|
|
|
.option = options,
|
|
|
|
|
.version = LIBAVUTIL_VERSION_INT,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const URLProtocol ff_dtls_protocol = {
|
|
|
|
|
.name = "dtls",
|
|
|
|
|
.url_open2 = dtls_open,
|
|
|
|
|
.url_read = tls_read,
|
|
|
|
|
.url_write = tls_write,
|
|
|
|
|
.url_close = tls_close,
|
|
|
|
|
.url_get_file_handle = tls_get_file_handle,
|
|
|
|
|
.url_get_short_seek = tls_get_short_seek,
|
|
|
|
|
.priv_data_size = sizeof(TLSContext),
|
|
|
|
|
.flags = URL_PROTOCOL_FLAG_NETWORK,
|
|
|
|
|
.priv_data_class = &dtls_class,
|
|
|
|
|
};
|