X-Git-Url: http://git.openwrt.org/?p=project%2Fustream-ssl.git;a=blobdiff_plain;f=ustream-mbedtls.c;fp=ustream-mbedtls.c;h=1bea9832617f514acaf81372b863e4411eb52dc2;hp=3424743c64521105e6facf39a3035eec1284fc5a;hb=55c3fd89d50805b7bdd5bcee3a43986f983f20db;hpb=c6b4c48689a3e80a6fd26a66f8699a2d8aaece6d diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c index 3424743..1bea983 100644 --- a/ustream-mbedtls.c +++ b/ustream-mbedtls.c @@ -290,6 +290,18 @@ __hidden int __ustream_ssl_set_ciphers(struct ustream_ssl_ctx *ctx, const char * return 0; } +__hidden int __ustream_ssl_set_require_validation(struct ustream_ssl_ctx *ctx, bool require) +{ + int mode = MBEDTLS_SSL_VERIFY_OPTIONAL; + + if (!require) + mode = MBEDTLS_SSL_VERIFY_NONE; + + mbedtls_ssl_conf_authmode(&ctx->conf, mode); + + return 0; +} + __hidden void __ustream_ssl_context_free(struct ustream_ssl_ctx *ctx) { #if defined(MBEDTLS_SSL_CACHE_C)