A simple PeerConnector for SSL/TLS cache_peers. No SslBump capabilities. More...

#include <BlindPeerConnector.h>

Inheritance diagram for Security::BlindPeerConnector:
Collaboration diagram for Security::BlindPeerConnector:

Public Types

typedef CbcPointer< PeerConnectorPointer

Public Member Functions

 BlindPeerConnector (HttpRequestPointer &aRequest, const Comm::ConnectionPointer &aServerConn, AsyncCall::Pointer &aCallback, const AccessLogEntryPointer &alp, const time_t timeout=0)
virtual bool initialize (Security::SessionPointer &)
virtual Security::ContextPointer getTlsContext ()
 Return the configured TLS context object. More...
virtual void noteNegotiationDone (ErrorState *)
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 (BlindPeerConnector)

Detailed Description

Definition at line 20 of file BlindPeerConnector.h.

Member Typedef Documentation

◆ Pointer

Definition at line 68 of file PeerConnector.h.

Constructor & Destructor Documentation

◆ BlindPeerConnector()

Security::BlindPeerConnector::BlindPeerConnector ( HttpRequestPointer aRequest,
const Comm::ConnectionPointer aServerConn,
AsyncCall::Pointer aCallback,
const AccessLogEntryPointer alp,
const time_t  timeout = 0 

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().


Security::BlindPeerConnector::CBDATA_CLASS ( BlindPeerConnector  )

◆ 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()

◆ 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 Security::BlindPeerConnector::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 Security::BlindPeerConnector::noteNegotiationDone ( ErrorState error)

On error calls peerConnectFailed(). On success store the used TLS session for later use.

Reimplemented from Security::PeerConnector.

Definition at line 66 of file BlindPeerConnector.cc.

References debugs, Comm::Connection::fd, fd_table, Comm::Connection::getPeer(), Security::MaybeGetSessionResumeData(), peerConnectFailed(), and Security::PeerConnector::serverConnection().

Referenced by BlindPeerConnector().

◆ 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

◆ 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 files:






Web Site Translations