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 setReadTimeout ()
 
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 
)
inline

Member Function Documentation

◆ bail()

◆ bypassCertValidator()

void Security::PeerConnector::bypassCertValidator ( )
inlineprotectedinherited

◆ callBack()

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

Referenced by AsyncJob::swanSong().

◆ CBDATA_CLASS()

Security::BlindPeerConnector::CBDATA_CLASS ( BlindPeerConnector  )
private

◆ certDownloadingDone()

◆ checkForMissingCertificates()

bool Security::PeerConnector::checkForMissingCertificates ( )
protectedinherited

◆ commCloseHandler()

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

◆ connectionClosed()

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

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ done()

◆ doneAll()

bool Security::PeerConnector::doneAll ( ) const
protectedvirtualinherited

◆ getTlsContext()

Security::ContextPointer Security::BlindPeerConnector::getTlsContext ( )
virtual

◆ handleNegotiateError()

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

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 395 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)
virtual

Calls parent initialize(), configures the created TLS session object to try and reuse a TLS session and sets the hostname to use for certificate validation

Returns
true on successful initialization

Reimplemented from Security::PeerConnector.

Definition at line 33 of file BlindPeerConnector.cc.

References assert, debugs, AnyP::Uri::host(), Security::PeerConnector::initialize(), Security::PeerConnector::request, Security::PeerConnector::serverConnection(), Ssl::setClientSNI(), Security::SetSessionResumeData(), ssl_ex_index_server, and HttpRequest::url.

Referenced by BlindPeerConnector().

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)
protectedinherited

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(), 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 ( )
protectedinherited

◆ noteNegotiationDone()

void Security::BlindPeerConnector::noteNegotiationDone ( ErrorState error)
virtual

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

Reimplemented from Security::PeerConnector.

Definition at line 65 of file BlindPeerConnector.cc.

References debugs, Comm::Connection::fd, fd_table, Security::MaybeGetSessionResumeData(), p, 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 
)
protectedvirtualinherited

◆ noteWantRead()

void Security::PeerConnector::noteWantRead ( )
protectedinherited

◆ noteWantWrite()

void Security::PeerConnector::noteWantWrite ( )
protectedvirtualinherited

◆ prepareSocket()

bool Security::PeerConnector::prepareSocket ( )
protectedinherited

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

◆ setReadTimeout()

void Security::PeerConnector::setReadTimeout ( )
protectedinherited

◆ sslFinalized()

◆ Start()

◆ start()

void Security::PeerConnector::start ( )
protectedvirtualinherited

◆ startCertDownloading()

◆ status()

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

◆ swanSong()

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ al

◆ callback

◆ id

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ request

◆ serverConn

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ typeName


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors