Skip to content

Commit

Permalink
Use certificate chain in TLS transport with OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau authored and evaldemar committed Jun 7, 2024
1 parent 8c2b3f6 commit 92e144e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/impl/tlstransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ TlsTransport::TlsTransport(variant<shared_ptr<TcpTransport>, shared_ptr<HttpProx
auto [x509, pkey] = certificate->credentials();
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);
Expand Down

0 comments on commit 92e144e

Please sign in to comment.