From cf5cb0b524b3a8a1b3ef54ca87eff1a4a28e7838 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 22 Apr 2022 14:48:45 +0200 Subject: [PATCH] MEDIUM: httpclient/ssl: verify required The httpclient HTTPS requests now enable the "verify required" option. To achieve this, the "@system-ca" ca-file is configured in the httpclient ssl server. Which means all the system CAs will be loaded at haproxy startup. --- src/http_client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/http_client.c b/src/http_client.c index 0e9621713..60d05e6cb 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1039,7 +1040,11 @@ static int httpclient_precheck() if (!httpclient_srv_ssl->id) goto err; - httpclient_srv_ssl->ssl_ctx.verify = SSL_SOCK_VERIFY_NONE; + httpclient_srv_ssl->ssl_ctx.verify = SSL_SOCK_VERIFY_REQUIRED; + httpclient_srv_ssl->ssl_ctx.ca_file = strdup("@system-ca"); + if (!ssl_store_load_locations_file(httpclient_srv_ssl->ssl_ctx.ca_file, 1, CAFILE_CERT)) + goto err; + #endif /* add the proxy in the proxy list only if everything is successful */ -- 2.47.3