Disable cert verification when ssl_ca_cert is '*'

PUBLISHED_FROM=578706e48a2c1fbbf5e9aaab3eba743e7d13fa61
This commit is contained in:
Deomid Ryabkov authored and Cesanta Bot committed 2017-06-21 14:23:30 +00:00
1 parent f374ac5f9a
commit fb3a5a7d90
1 file changed
+1
+1
View File
@@ -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,
const char *ca_cert) {
if (ca_cert == NULL || strcmp(ca_cert, "*") == 0) {
mbedtls_ssl_conf_authmode(ctx->conf, MBEDTLS_SSL_VERIFY_NONE);
return MG_SSL_OK;
}
ctx->ca_cert = (mbedtls_x509_crt *) MG_CALLOC(1, sizeof(*ctx->ca_cert));