Commit fb3a5a7d authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Disable cert verification when ssl_ca_cert is '*'

PUBLISHED_FROM=578706e48a2c1fbbf5e9aaab3eba743e7d13fa61
parent f374ac5f
...@@ -4695,6 +4695,7 @@ void mg_ssl_if_conn_free(struct mg_connection *nc) { ...@@ -4695,6 +4695,7 @@ void mg_ssl_if_conn_free(struct mg_connection *nc) {
static enum mg_ssl_if_result mg_use_ca_cert(struct mg_ssl_if_ctx *ctx, static enum mg_ssl_if_result mg_use_ca_cert(struct mg_ssl_if_ctx *ctx,
const char *ca_cert) { const char *ca_cert) {
if (ca_cert == NULL || strcmp(ca_cert, "*") == 0) { if (ca_cert == NULL || strcmp(ca_cert, "*") == 0) {
mbedtls_ssl_conf_authmode(ctx->conf, MBEDTLS_SSL_VERIFY_NONE);
return MG_SSL_OK; return MG_SSL_OK;
} }
ctx->ca_cert = (mbedtls_x509_crt *) MG_CALLOC(1, sizeof(*ctx->ca_cert)); ctx->ca_cert = (mbedtls_x509_crt *) MG_CALLOC(1, sizeof(*ctx->ca_cert));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment