Merge pull request #3610 from cesanta/hostnoca

Allow hostname checking even when no CA cert was given
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2026-06-26 14:12:09 -03:00
commit ed19d5290e
8 files changed
+131 -48

No files matched your search

+5 -1
View File
@@ -3507,13 +3507,14 @@ struct mg_tls {
mbedtls_x509_crt cert; // Parsed certificate
mbedtls_pk_context pk; // Private key context
mbedtls_ssl_context ssl; // SSL/TLS context
mbedtls_ssl_config conf; // SSL-TLS config
mbedtls_ssl_config conf; // SSL/TLS config
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_context ticket; // Session tickets context
#endif
// https://github.com/Mbed-TLS/mbedtls/blob/3b3c652d/include/mbedtls/ssl.h#L5071C18-L5076C29
unsigned char *throttled_buf; // see #3074
size_t throttled_len;
bool check_name; // set when hostname was set, but no CA certificate given
};
#endif
@@ -3522,11 +3523,14 @@ struct mg_tls {
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
struct mg_tls {
BIO_METHOD *bm;
SSL_CTX *ctx;
SSL *ssl;
char *name; // matching hostname
bool check_name; // set when hostname was set, but no CA certificate given
};
#endif