From 92e144eed8dcfbf1684728cf9dfa912aae595bbe Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Mon, 27 May 2024 13:10:56 +0200 Subject: [PATCH] Use certificate chain in TLS transport with OpenSSL --- src/impl/tlstransport.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/impl/tlstransport.cpp b/src/impl/tlstransport.cpp index 8f66d200f..0f5e9e967 100644 --- a/src/impl/tlstransport.cpp +++ b/src/impl/tlstransport.cpp @@ -603,6 +603,9 @@ TlsTransport::TlsTransport(variant, shared_ptrcredentials(); SSL_CTX_use_certificate(mCtx, x509); SSL_CTX_use_PrivateKey(mCtx, pkey); + + for (auto c : certificate->chain()) + SSL_CTX_add1_chain_cert(mCtx, c); // add1 increments reference count } SSL_CTX_set_options(mCtx, SSL_OP_NO_SSLv3 | SSL_OP_NO_RENEGOTIATION);