Skip to content

Commit

Permalink
[XrdTlsSocket] Shutdown the socket if a SSL error happens when trying…
Browse files Browse the repository at this point in the history
… to accept a connection

If we do not do that, next time a XROOTD client using the link that got an SSL error
will see a SSL Socket error and will have to retry
  • Loading branch information
ccaffy authored and simonmichal committed Oct 4, 2022
1 parent f9e180c commit 71a749c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/XrdTls/XrdTlsSocket.cc
Expand Up @@ -216,8 +216,15 @@ do{if ((rc = SSL_accept( pImpl->ssl )) > 0)

// Check why we did not succeed. We may be able to recover.
//
if (ssler != SSL_ERROR_WANT_READ && ssler != SSL_ERROR_WANT_WRITE)
{aOK = false; break;}
if (ssler != SSL_ERROR_WANT_READ && ssler != SSL_ERROR_WANT_WRITE) {
if(ssler == SSL_ERROR_SSL){
//In the case the accept does have an error related to OpenSSL,
//shutdown the TLSSocket in case the link associated to that connection
//is re-used
Shutdown();
}
aOK = false; break;
}

if (pImpl->hsNoBlock) return XrdTls::ssl2RC(ssler);

Expand Down

0 comments on commit 71a749c

Please sign in to comment.