2021-12-14 20:42:41 +08:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-24 10:20:45 +08:00
|
|
|
#include "config.h"
|
2021-12-14 20:42:41 +08:00
|
|
|
#include "log.h"
|
|
|
|
#include "url.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
2022-01-24 10:20:45 +08:00
|
|
|
#if MG_ENABLE_MBEDTLS
|
2021-12-14 20:42:41 +08:00
|
|
|
#include <mbedtls/debug.h>
|
2022-01-19 01:11:02 +08:00
|
|
|
#include <mbedtls/net_sockets.h>
|
2021-12-14 20:42:41 +08:00
|
|
|
#include <mbedtls/ssl.h>
|
|
|
|
|
|
|
|
struct mg_tls {
|
|
|
|
char *cafile; // CA certificate path
|
|
|
|
mbedtls_x509_crt ca; // Parsed CA certificate
|
|
|
|
mbedtls_x509_crt cert; // Parsed certificate
|
|
|
|
mbedtls_ssl_context ssl; // SSL/TLS context
|
|
|
|
mbedtls_ssl_config conf; // SSL-TLS config
|
|
|
|
mbedtls_pk_context pk; // Private key context
|
|
|
|
};
|
|
|
|
#endif
|