Skip to content

Commit

Permalink
[XrdCl] Respect server TLS setting in presence of --tlsnodata.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jun 19, 2020
1 parent 5752b73 commit 1499b75
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/XrdCl/XrdClXRootDTransport.cc
Expand Up @@ -885,12 +885,19 @@ namespace XrdCl
int nodata = DefaultTlsNoData;
env->GetInt( "TlsNoData", nodata );

if( ( info->encrypted && nodata ) ||
( ( ( info->serverFlags & kXR_gotoTLS ) ||
( info->serverFlags & kXR_tlsLogin ) ||
( info->serverFlags & kXR_tlsSess ) ) &&
!( info->serverFlags & kXR_tlsData ) &&
!info->encrypted ) )
// Does the server require the stream 0 to be encrypted?
bool srvTlsStrm0 = ( info->serverFlags & kXR_gotoTLS ) ||
( info->serverFlags & kXR_tlsLogin ) ||
( info->serverFlags & kXR_tlsSess );
// Does the server NOT require the data streams to be encrypted?
bool srvNoTlsData = !( info->serverFlags & kXR_tlsData );
// Does the user require the stream 0 to be encrypted?
bool usrTlsStrm0 = info->encrypted;
// Does the user NOT require the data streams to be encrypted?
bool usrNoTlsData = !info->encrypted || ( info->encrypted && nodata );

if( ( usrTlsStrm0 && usrNoTlsData && srvNoTlsData ) ||
( srvTlsStrm0 && srvNoTlsData && usrNoTlsData ) )
{
//------------------------------------------------------------------------
// The server or user asked us to encrypt stream 0, but to send the data
Expand Down

0 comments on commit 1499b75

Please sign in to comment.