xrootd
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
XrdTls Class Reference

#include <XrdTls.hh>

Public Types

enum  RC {
  TLS_AOK = 0 , TLS_CON_Closed , TLS_CRT_Missing , TLS_CTX_Missing ,
  TLS_HNV_Error , TLS_SSL_Error , TLS_SYS_Error , TLS_UNK_Error ,
  TLS_VER_Error , TLS_WantAccept , TLS_WantConnect , TLS_WantRead ,
  TLS_WantWrite
}
 
typedef void(* msgCB_t) (const char *tid, const char *msg, bool sslmsg)
 

Static Public Member Functions

static void Emsg (const char *tid, const char *msg=0, bool flush=true)
 
static std::string RC2Text (XrdTls::RC rc, bool dbg=false)
 
static void SetMsgCB (msgCB_t cbP)
 
static void SetDebug (int opts, XrdSysLogger *logP=0)
 
static void SetDebug (int opts, msgCB_t logP)
 
static RC ssl2RC (int sslrc)
 
static const char * ssl2Text (int sslrc, const char *dflt="unknown_error")
 
static void ClearErrorQueue ()
 Clear the SSL error queue for the calling thread.
 

Static Public Attributes

static const int dbgOFF = 0
 Turn debugging off (initial deault)
 
static const int dbgCTX = 1
 Turn debugging in for context operations.
 
static const int dbgSOK = 2
 Turn debugging in for socket operations.
 
static const int dbgSIO = 4
 Turn debugging in for socket I/O.
 
static const int dbgALL = 7
 Turn debugging for everything.
 
static const int dbgOUT = 8
 Force msgs to stderr for easier client debug.
 

Member Typedef Documentation

◆ msgCB_t

typedef void(* XrdTls::msgCB_t) (const char *tid, const char *msg, bool sslmsg)

Set the message callback.

Parameters
cbPPointer to the message callback function. If nil, messages are sent to stderr. This is a global setting.
Note
You should establish a callback once in the main thread.

Member Enumeration Documentation

◆ RC

enum XrdTls::RC
Enumerator
TLS_AOK 

All went well, will always be zero.

TLS_CON_Closed 

TLS connection has been closed.

TLS_CRT_Missing 

The x509 certificate missing.

TLS_CTX_Missing 

The TLS context is missing.

TLS_HNV_Error 

A hostname validation error occuured.

TLS_SSL_Error 

An SSL error occurred.

TLS_SYS_Error 

A system call error occurred.

TLS_UNK_Error 

An unknown error occurred.

TLS_VER_Error 

Certificate verification failed.

TLS_WantAccept 

Reissue call when Accept() completes.

TLS_WantConnect 

Reissue call when Connect() completes.

TLS_WantRead 

Reissue call when reads do not block.

TLS_WantWrite 

Reissue call when writes do not block.

Member Function Documentation

◆ ClearErrorQueue()

static void XrdTls::ClearErrorQueue ( )
static

Clear the SSL error queue for the calling thread.

◆ Emsg()

static void XrdTls::Emsg ( const char *  tid,
const char *  msg = 0,
bool  flush = true 
)
static

Route an optional error message and flush outstanding messages.

Parameters
tid- Optional trace identifier.
msg- An optional message.
flush- If true prints all outstanding ssl messages. Otherwise, it clears all outstanding sll messages.

◆ RC2Text()

static std::string XrdTls::RC2Text ( XrdTls::RC  rc,
bool  dbg = false 
)
static

Convert TLS RC code to a reason string.

Parameters
rc- The TLS return code.
dbg- True to include additional identifying text. Otherwise, a concise message decribing the error is returned.
Returns
A string describing the error.

◆ SetDebug() [1/2]

static void XrdTls::SetDebug ( int  opts,
msgCB_t  logP 
)
static

◆ SetDebug() [2/2]

static void XrdTls::SetDebug ( int  opts,
XrdSysLogger logP = 0 
)
static

◆ SetMsgCB()

static void XrdTls::SetMsgCB ( msgCB_t  cbP)
static

◆ ssl2RC()

static RC XrdTls::ssl2RC ( int  sslrc)
static

Convert SSL error to TLS::RC code.

Parameters
sslrc- the SSL error return code.
Returns
The corresponding TLS::RC code.

◆ ssl2Text()

static const char * XrdTls::ssl2Text ( int  sslrc,
const char *  dflt = "unknown_error" 
)
static

Convert SSL error to text.

Parameters
sslrc- the SSL error return code.
dflt- the default to be return when mapping does no exist.
Returns
The corresponding text or the dflt string is returned.
Note
This is provided because some versions of OpenSSL do not provide a reasonable textual reason no matter what you use.

Member Data Documentation

◆ dbgALL

const int XrdTls::dbgALL = 7
static

Turn debugging for everything.

◆ dbgCTX

const int XrdTls::dbgCTX = 1
static

Turn debugging in for context operations.

◆ dbgOFF

const int XrdTls::dbgOFF = 0
static

Turn debugging off (initial deault)

Set debugging on or off.

Parameters
optsOne of or more of the options below.
logPPointer to XrdSysLogger or the message callback (see above) to route messages. If nil messages are routed to stderr.

◆ dbgOUT

const int XrdTls::dbgOUT = 8
static

Force msgs to stderr for easier client debug.

◆ dbgSIO

const int XrdTls::dbgSIO = 4
static

Turn debugging in for socket I/O.

◆ dbgSOK

const int XrdTls::dbgSOK = 2
static

Turn debugging in for socket operations.


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