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 committed May 27, 2024
1 parent ce0744b commit fc428f4
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 fc428f4

Please sign in to comment.