TLS API refactor

This commit is contained in:
cpq committed 2023-07-25 13:07:28 +01:00
1 parent d9cbcb5fa8
commit 0613cc62f4
26 files changed
+1180 -1088

No files matched your search

+14 -5
View File
@@ -5,17 +5,26 @@
#include "url.h"
#include "util.h"
#if MG_ENABLE_MBEDTLS
#if MG_TLS == MG_TLS_MBED
#include <mbedtls/debug.h>
#include <mbedtls/net_sockets.h>
#include <mbedtls/ssl.h>
#include <mbedtls/ssl_ticket.h>
struct mg_tls_ctx {
mbedtls_x509_crt server_ca; // Parsed CA certificate
mbedtls_x509_crt client_ca; // Parsed CA certificate
mbedtls_x509_crt server_cert; // Parsed server certificate
mbedtls_pk_context server_key; // Parsed server private key context
mbedtls_x509_crt client_cert; // Parsed client certificate
mbedtls_pk_context client_key; // Parsed client private key context
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_context ticket_ctx; // Session tickets context
#endif
};
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