xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
XrdCl::Tls Class Reference

TLS layer for socket connection. More...

#include <XrdClTls.hh>

Collaboration diagram for XrdCl::Tls:
Collaboration graph
[legend]

Public Member Functions

 Tls (Socket *socket, AsyncSocketHandler *socketHandler)
 Constructor - creates async TLS layer for given socker file descriptor.
 
 ~Tls ()
 Destructor.
 
XRootDStatus Connect (const std::string &thehost, XrdNetAddrInfo *netInfo)
 Establish a TLS/SSL session and perform host verification.
 
XRootDStatus Read (char *buffer, size_t size, int &bytesRead)
 
XRootDStatus ReadV (iovec *iov, int iocnt, int &bytesRead)
 
XRootDStatus Send (const char *buffer, size_t size, int &bytesWritten)
 
void Shutdown ()
 Shutdown the TLS/SSL connection.
 
uint8_t MapEvent (uint8_t event)
 

Static Public Member Functions

static void ClearErrorQueue ()
 Clear the error queue for the calling thread.
 

Private Types

enum  TlsHSRevert { None , ReadOnWrite , WriteOnRead }
 

Private Member Functions

XRootDStatus ToStatus (XrdTls::RC rc)
 Translate OPEN SSL error code into XRootD Status.
 

Private Attributes

SocketpSocket
 The underlying vanilla socket.
 
std::unique_ptr< XrdTlsSocketpTls
 The TSL I/O wrapper over socket.
 
TlsHSRevert pTlsHSRevert
 
AsyncSocketHandlerpSocketHandler
 Socket handler (for enabling/disabling write notification)
 

Detailed Description

TLS layer for socket connection.

Member Enumeration Documentation

◆ TlsHSRevert

Flags to indicate what is the TLS hand-shake revert state

  • None : there is no revert state
  • ReadOnWrite : OnRead routines will be called on write event due to TLS handshake
  • WriteOnRead : OnWrite routines will be called on read event due to TLS handshake
Enumerator
None 
ReadOnWrite 
WriteOnRead 

Constructor & Destructor Documentation

◆ Tls()

XrdCl::Tls::Tls ( Socket socket,
AsyncSocketHandler socketHandler 
)

Constructor - creates async TLS layer for given socker file descriptor.

◆ ~Tls()

XrdCl::Tls::~Tls ( )
inline

Destructor.

Member Function Documentation

◆ ClearErrorQueue()

static void XrdCl::Tls::ClearErrorQueue ( )
static

Clear the error queue for the calling thread.

◆ Connect()

XRootDStatus XrdCl::Tls::Connect ( const std::string &  thehost,
XrdNetAddrInfo netInfo 
)

Establish a TLS/SSL session and perform host verification.

◆ MapEvent()

uint8_t XrdCl::Tls::MapEvent ( uint8_t  event)

Map:

  • in case the TLS layer requested reads on writes map ReadyToWrite to ReadyToRead
  • in case the TLS layer requested writes on reads map ReadyToRead to ReadyToWrite

◆ Read()

XRootDStatus XrdCl::Tls::Read ( char *  buffer,
size_t  size,
int &  bytesRead 
)

Read through the TLS layer from the socket If necessary, will establish a TLS/SSL session.

◆ ReadV()

XRootDStatus XrdCl::Tls::ReadV ( iovec *  iov,
int  iocnt,
int &  bytesRead 
)

(Fake) ReadV through the TLS layer from the socket If necessary, will establish a TLS/SSL session.

◆ Send()

XRootDStatus XrdCl::Tls::Send ( const char *  buffer,
size_t  size,
int &  bytesWritten 
)

Write through the TLS layer to the socket If necessary, will establish a TLS/SSL session.

◆ Shutdown()

void XrdCl::Tls::Shutdown ( )

Shutdown the TLS/SSL connection.

◆ ToStatus()

XRootDStatus XrdCl::Tls::ToStatus ( XrdTls::RC  rc)
private

Translate OPEN SSL error code into XRootD Status.

Member Data Documentation

◆ pSocket

Socket* XrdCl::Tls::pSocket
private

The underlying vanilla socket.

◆ pSocketHandler

AsyncSocketHandler* XrdCl::Tls::pSocketHandler
private

Socket handler (for enabling/disabling write notification)

◆ pTls

std::unique_ptr<XrdTlsSocket> XrdCl::Tls::pTls
private

The TSL I/O wrapper over socket.

◆ pTlsHSRevert

TlsHSRevert XrdCl::Tls::pTlsHSRevert
private

The documentation for this class was generated from the following file: