2021-12-14 12:42:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-24 02:20:45 +00:00
|
|
|
#include "config.h"
|
2021-12-14 12:42:41 +00:00
|
|
|
#include "log.h"
|
|
|
|
#include "url.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
2023-07-25 13:07:28 +01:00
|
|
|
#if MG_TLS == MG_TLS_MBED
|
2021-12-14 12:42:41 +00:00
|
|
|
#include <mbedtls/debug.h>
|
2022-01-18 17:11:02 +00:00
|
|
|
#include <mbedtls/net_sockets.h>
|
2021-12-14 12:42:41 +00:00
|
|
|
#include <mbedtls/ssl.h>
|
2023-07-25 13:07:28 +01:00
|
|
|
#include <mbedtls/ssl_ticket.h>
|
|
|
|
|
2023-09-21 18:43:33 +01:00
|
|
|
struct mg_tls_ctx {
|
|
|
|
int dummy;
|
|
|
|
#ifdef MBEDTLS_SSL_SESSION_TICKETS
|
|
|
|
mbedtls_ssl_ticket_context tickets;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2021-12-14 12:42:41 +00:00
|
|
|
struct mg_tls {
|
2023-09-17 09:07:57 +01:00
|
|
|
mbedtls_x509_crt ca; // Parsed CA certificate
|
|
|
|
mbedtls_x509_crt cert; // Parsed certificate
|
|
|
|
mbedtls_pk_context pk; // Private key context
|
2021-12-14 12:42:41 +00:00
|
|
|
mbedtls_ssl_context ssl; // SSL/TLS context
|
|
|
|
mbedtls_ssl_config conf; // SSL-TLS config
|
2023-09-17 09:07:57 +01:00
|
|
|
#ifdef MBEDTLS_SSL_SESSION_TICKETS
|
|
|
|
mbedtls_ssl_ticket_context ticket; // Session tickets context
|
|
|
|
#endif
|
2021-12-14 12:42:41 +00:00
|
|
|
};
|
|
|
|
#endif
|