Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XrdTlsContext] Free the SSL Context when a new one is going to be used to generate the session #1792

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/XrdTls/XrdTlsContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,11 @@ void *XrdTlsContext::Session()
SSL_CTX_set1_verify_cert_store(pImpl->ctx, newX509);
SSL_CTX_set1_chain_cert_store(pImpl->ctx, newX509);*/
//The above two macros actually do not replace the certificate that has
//to be used for that SSL session, so we will generate the session with the SSL_CTX * of
//to be used for that SSL session, so we will create the session with the SSL_CTX * of
//the TlsContext created by Refresh()
//First, free the current SSL_CTX, if it is used by any transfer, it will just decrease
//the reference counter of it. There is therefore no risk of double free...
SSL_CTX_free(pImpl->ctx);
pImpl->ctx = ctxnew->pImpl->ctx;
//In the destructor of XrdTlsContextImpl, SSL_CTX_Free() is
//called if ctx is != 0. As this new ctx is used by the session
Expand Down