A simple PeerConnector for Secure ICAP services. No SslBump capabilities. More...

Inheritance diagram for Ssl::IcapPeerConnector:
Collaboration diagram for Ssl::IcapPeerConnector:

Public Types

typedef CbcPointer< PeerConnectorPointer

Public Member Functions

 IcapPeerConnector (Adaptation::Icap::ServiceRep::Pointer &service, const Comm::ConnectionPointer &aServerConn, AsyncCall::Pointer &aCallback, AccessLogEntry::Pointer const &alp, const time_t timeout=0)
virtual bool initialize (Security::SessionPointer &)
virtual void noteNegotiationDone (ErrorState *error)
virtual Security::ContextPointer getTlsContext ()
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
void callStart (AsyncCall &call)
virtual void callEnd ()
 called right after the called job method More...
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
virtual void * toCbdata ()=0

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...

Protected Member Functions

virtual void start ()
 Preps connection and SSL state. Calls negotiate(). More...
virtual bool doneAll () const
 whether positive goal has been reached More...
virtual void swanSong ()
virtual const char * status () const
 internal cleanup; do not call directly More...
void commCloseHandler (const CommCloseCbParams &params)
 The comm_close callback handler. More...
void connectionClosed (const char *reason)
 Inform us that the connection is closed. Does the required clean-up. More...
bool prepareSocket ()
void negotiate ()
bool sslFinalized ()
void handleNegotiateError (const int result)
void noteWantRead ()
bool checkForMissingCertificates ()
void startCertDownloading (SBuf &url)
 Start downloading procedure for the given URL. More...
void certDownloadingDone (SBuf &object, int status)
 Called by Downloader after a certificate object downloaded. More...
virtual void noteWantWrite ()
virtual void noteNegotiationError (const int result, const int ssl_error, const int ssl_lib_error)
Comm::ConnectionPointer const & serverConnection () const
 mimics FwdState to minimize changes to FwdState::initiate/negotiateSsl More...
void bail (ErrorState *error)
 Return an error to the PeerConnector caller. More...
void callBack ()
void bypassCertValidator ()
 If called the certificates validator will not used. More...
void recordNegotiationDetails ()
void deleteThis (const char *aReason)
void mustStop (const char *aReason)
bool done () const
 the job is destroyed in callEnd() when done() More...

Protected Attributes

HttpRequestPointer request
 peer connection trigger or cause More...
Comm::ConnectionPointer serverConn
 TCP connection to the peer. More...
AccessLogEntryPointer al
 info for the future access.log entry More...
AsyncCall::Pointer callback
 we call this with the results More...
const char * stopReason
 reason for forcing done() to be true More...
const char * typeName
 kid (leaf) class name, for debugging More...
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
const InstanceId< AsyncJobid
 job identifier More...

Private Member Functions

 CBDATA_CLASS (IcapPeerConnector)

Private Attributes

Adaptation::Icap::ServiceRep::Pointer icapService

Detailed Description

Definition at line 50 of file Xaction.cc.

Member Typedef Documentation

◆ Pointer

Definition at line 68 of file PeerConnector.h.

Constructor & Destructor Documentation

◆ IcapPeerConnector()

Ssl::IcapPeerConnector::IcapPeerConnector ( Adaptation::Icap::ServiceRep::Pointer service,
const Comm::ConnectionPointer aServerConn,
AsyncCall::Pointer aCallback,
AccessLogEntry::Pointer const &  alp,
const time_t  timeout = 0 

Definition at line 53 of file Xaction.cc.

References error().

Member Function Documentation

◆ bail()

◆ bypassCertValidator()

void Security::PeerConnector::bypassCertValidator ( )

◆ callBack()

◆ callEnd()

void AsyncJob::callEnd ( )

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Referenced by AsyncJob::swanSong().


Ssl::IcapPeerConnector::CBDATA_CLASS ( IcapPeerConnector  )

◆ certDownloadingDone()

◆ checkForMissingCertificates()

bool Security::PeerConnector::checkForMissingCertificates ( )

◆ commCloseHandler()

void Security::PeerConnector::commCloseHandler ( const CommCloseCbParams params)

◆ connectionClosed()

void Security::PeerConnector::connectionClosed ( const char *  reason)

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)

◆ done()

◆ doneAll()

bool Security::PeerConnector::doneAll ( ) const

◆ getTlsContext()

virtual Security::ContextPointer Ssl::IcapPeerConnector::getTlsContext ( )

Must implemented by the kid classes to return the TLS context object to use for building the encryption context objects.

Implements Security::PeerConnector.

Definition at line 65 of file Xaction.cc.

◆ handleNegotiateError()

void Security::PeerConnector::handleNegotiateError ( const int  result)

Called when the negotiation step aborted because data needs to be transferred to/from server or on error. In the first case setups the appropriate Comm::SetSelect handler. In second case fill an error and report to the PeerConnector caller.

Definition at line 382 of file PeerConnector.cc.

References DBG_IMPORTANT, debugs, Comm::Connection::fd, fd_table, Must, Security::PeerConnector::noteNegotiationError(), Security::PeerConnector::noteWantRead(), Security::PeerConnector::noteWantWrite(), Security::PeerConnector::recordNegotiationDetails(), and Security::PeerConnector::serverConnection().

Referenced by Security::PeerConnector::negotiate(), and Security::PeerConnector::CbDialer::~CbDialer().

◆ initialize()

bool Ssl::IcapPeerConnector::initialize ( Security::SessionPointer serverSession)

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)

Definition at line 69 of file AsyncJob.cc.

References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.

Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Http::Tunneler::handleConnectionClosure(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), Adaptation::Ecap::XactionRep::noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().

◆ negotiate()

void Security::PeerConnector::negotiate ( )

◆ noteNegotiationDone()

void Ssl::IcapPeerConnector::noteNegotiationDone ( ErrorState error)

Called when the SSL negotiation to the server completed and the certificates validated using the cert validator.

errorif not NULL the SSL negotiation was aborted with an error

Reimplemented from Security::PeerConnector.

Definition at line 728 of file Xaction.cc.

References fd_table, and Security::MaybeGetSessionResumeData().

◆ noteNegotiationError()

void Security::PeerConnector::noteNegotiationError ( const int  result,
const int  ssl_error,
const int  ssl_lib_error 

Called when the SSL_connect function aborts with an SSL negotiation error

resultthe SSL_connect return code
ssl_errorthe error code returned from the SSL_get_error function
ssl_lib_errorthe error returned from the ERR_Get_Error function

Reimplemented in Ssl::PeekingPeerConnector.

Definition at line 491 of file PeerConnector.cc.

References Security::PeerConnector::al, Security::PeerConnector::bail(), DBG_IMPORTANT, debugs, ERR_SECURE_CONNECT_FAIL, Security::ErrorString(), Comm::Connection::fd, fd_table, ErrorState::NewForwarding(), Security::PeerConnector::noteNegotiationDone(), NULL, Security::PeerConnector::request, Security::PeerConnector::serverConnection(), SQUID_ERR_SSL_HANDSHAKE, and ssl_ex_index_ssl_error_detail.

Referenced by Security::PeerConnector::handleNegotiateError(), Ssl::PeekingPeerConnector::noteNegotiationError(), and Security::PeerConnector::CbDialer::~CbDialer().

◆ noteWantRead()

◆ noteWantWrite()

void Security::PeerConnector::noteWantWrite ( )

◆ prepareSocket()

bool Security::PeerConnector::prepareSocket ( )

Sets up TCP socket-related notification callbacks if things go wrong. If socket already closed return false, else install the comm_close handler to monitor the socket.

Definition at line 87 of file PeerConnector.cc.

References Security::PeerConnector::closeHandler, comm_add_close_handler(), Security::PeerConnector::commCloseHandler(), Security::PeerConnector::connectionClosed(), debugs, fd_table, Comm::IsConnOpen(), JobCallback, and Security::PeerConnector::serverConnection().

Referenced by Security::PeerConnector::start(), and Security::PeerConnector::CbDialer::~CbDialer().

◆ recordNegotiationDetails()

◆ serverConnection()

◆ sslFinalized()

◆ Start()

◆ start()

void Security::PeerConnector::start ( )

◆ startCertDownloading()

◆ status()

const char * Security::PeerConnector::status ( ) const

◆ swanSong()

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ al

◆ callback

◆ icapService

Adaptation::Icap::ServiceRep::Pointer Ssl::IcapPeerConnector::icapService

Definition at line 70 of file Xaction.cc.

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ request

◆ serverConn

◆ stopReason

const char* AsyncJob::stopReason

◆ typeName

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






Web Site Translations