From 29769e5398f92b0f9bc3bd337eb861530ef68d1f Mon Sep 17 00:00:00 2001 From: helintongh Date: Sat, 29 Jul 2023 11:40:58 +0800 Subject: [PATCH] feat: [client] when cert path is empty, set default cert path (#381) --- include/cinatra/coro_http_client.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cinatra/coro_http_client.hpp b/include/cinatra/coro_http_client.hpp index 21877870..558086c4 100644 --- a/include/cinatra/coro_http_client.hpp +++ b/include/cinatra/coro_http_client.hpp @@ -252,6 +252,10 @@ class coro_http_client { return false; } + if (base_path.empty() && cert_file.empty()) { + ssl_ctx_->set_default_verify_paths(); + } + ssl_ctx_->set_verify_mode(verify_mode); // ssl_ctx_.add_certificate_authority(asio::buffer(CA_PEM));