commit 407af385f71f4fa0ae54f297e95324b83a08b887
parent 32c96b344276b4652facae66c456991854ccb17e
Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 7 Jun 2020 14:27:18 +0200
Make cert and name verification an option.
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net.c b/net.c
@@ -173,8 +173,14 @@ net_addssl(net_t *net)
tls_free(tls);
return 1;
}
- tls_config_insecure_noverifycert(config);
- tls_config_insecure_noverifyname(config);
+
+ if (net->options != NULL) {
+ if (strstr(net->options, "tlscertverify=off"))
+ tls_config_insecure_noverifycert(config);
+ if (strstr(net->options, "tlsnameverify=off"))
+ tls_config_insecure_noverifycert(config);
+ }
+
if (tls_configure(tls, config) < 0) {
fprintf(stderr, "tls_configure: %s\n", tls_error(tls));
tls_free(tls);