#include <ErrorDetail.h>

Collaboration diagram for Ssl::ErrorDetail:


class  err_frm_code

Public Member Functions

 ErrorDetail (Security::ErrorCode err_no, X509 *peer, X509 *broken, const char *aReason=NULL)
 ErrorDetail (ErrorDetail const &)
const StringtoString () const
 An error detail string to embed in squid error pages. More...
void useRequest (HttpRequest *aRequest)
const char * errorName () const
 The error name to embed in squid error pages. More...
Security::ErrorCode errorNo () const
 The error no. More...
void setLibError (unsigned long lib_err_no)
 Sets the low-level error returned by OpenSSL ERR_get_error() More...
X509 * peerCert ()
 the peer certificate More...
X509 * brokenCert ()
 peer or intermediate certificate that failed validation More...

Private Types

typedef const char *(ErrorDetail::* fmt_action_t )() const

Private Member Functions

const char * subject () const
const char * ca_name () const
const char * cn () const
const char * notbefore () const
const char * notafter () const
const char * err_code () const
const char * err_descr () const
const char * err_lib_error () const
int convert (const char *code, const char **value) const
void buildDetail () const

Private Attributes

String errDetailStr
 Caches the error detail message. More...
Security::ErrorCode error_no
 The error code. More...
unsigned long lib_error_no
 low-level error returned by OpenSSL ERR_get_error(3SSL) More...
Security::CertPointer peer_cert
 A pointer to the peer certificate. More...
Security::CertPointer broken_cert
 A pointer to the broken certificate (peer or intermediate) More...
String errReason
 A custom reason for error, else retrieved from OpenSSL. More...
ErrorDetailEntry detailEntry
HttpRequest::Pointer request

Static Private Attributes

static err_frm_code ErrorFormatingCodes []
 The supported formating codes. More...

Detailed Description

Used to pass SSL error details to the error pages returned to the end user.

Definition at line 42 of file ErrorDetail.h.

Member Typedef Documentation

typedef const char*(ErrorDetail::* Ssl::ErrorDetail::fmt_action_t)() const

Definition at line 61 of file ErrorDetail.h.

Constructor & Destructor Documentation

Ssl::ErrorDetail::ErrorDetail ( Security::ErrorCode  err_no,
X509 *  peer,
X509 *  broken,
const char *  aReason = NULL 
Ssl::ErrorDetail::ErrorDetail ( Ssl::ErrorDetail const &  anErrDetail)

Member Function Documentation

X509* Ssl::ErrorDetail::brokenCert ( )
void Ssl::ErrorDetail::buildDetail ( ) const

It uses the convert method to build the string errDetailStr using a template message for the current SSL error. The template messages can also contain normal error pages formating codes. Currently the error template messages are hard-coded

Definition at line 608 of file ErrorDetail.cc.

References assert, Ssl::ErrorDetailsManager::GetInstance(), NULL, p, request(), and SslErrorDetailDefaultStr.

const char * Ssl::ErrorDetail::ca_name ( ) const

The issuer name

Definition at line 484 of file ErrorDetail.cc.

References html_quote().

const char * Ssl::ErrorDetail::cn ( ) const

The list with certificates cn and alternate names

< A temporary string buffer

Definition at line 466 of file ErrorDetail.cc.

References String::clean(), copy_cn(), html_quote(), Ssl::matchX509CommonNames(), String::size(), and String::termedBuf().

int Ssl::ErrorDetail::convert ( const char *  code,
const char **  value 
) const

Converts the code to a string value. Supported formating codes are:

Error meta information: err_name: The name of a high-level SSL error (e.g., X509_V_ERR_*) ssl_error_descr: A short description of the SSL error ssl_lib_error: human-readable low-level error string by Security::ErrorString()

Certificate information extracted from broken (not necessarily peer!) cert ssl_cn: The comma-separated list of common and alternate names ssl_subject: The certificate subject ssl_ca_name: The certificate issuer name ssl_notbefore: The certificate "not before" field ssl_notafter: The certificate "not after" field

Return values
thelength of the code (the number of characters will be replaced by value)

Definition at line 588 of file ErrorDetail.cc.

References action(), i, len, and NULL.

const char * Ssl::ErrorDetail::err_code ( ) const

The string representation of the error_no

Definition at line 530 of file ErrorDetail.cc.

References Ssl::GetErrorName().

Referenced by errorName().

const char * Ssl::ErrorDetail::err_descr ( ) const

A short description of the error_no

Definition at line 552 of file ErrorDetail.cc.

const char * Ssl::ErrorDetail::err_lib_error ( ) const

Definition at line 561 of file ErrorDetail.cc.

References Security::ErrorString().

const char* Ssl::ErrorDetail::errorName ( ) const

Definition at line 51 of file ErrorDetail.h.

References err_code().

Referenced by ErrorState::Convert().

Security::ErrorCode Ssl::ErrorDetail::errorNo ( ) const

Definition at line 53 of file ErrorDetail.h.

References error_no.

Referenced by ErrorState::BuildHttpReply().

const char * Ssl::ErrorDetail::notafter ( ) const

The certificate "not after" field

Definition at line 515 of file ErrorDetail.cc.

References Ssl::asn1timeToString(), and X509_getm_notAfter.

const char * Ssl::ErrorDetail::notbefore ( ) const

The certificate "not before" field

Definition at line 500 of file ErrorDetail.cc.

References Ssl::asn1timeToString(), and X509_getm_notBefore.

X509* Ssl::ErrorDetail::peerCert ( )
void Ssl::ErrorDetail::setLibError ( unsigned long  lib_err_no)

Definition at line 55 of file ErrorDetail.h.

References lib_error_no.

Referenced by Security::PeerConnector::noteNegotiationError().

const char * Ssl::ErrorDetail::subject ( ) const

The subject of the current certification in text form

Definition at line 436 of file ErrorDetail.cc.

References broken_cert, Security::LockingPointer< T, UnLocker, Locker >::get(), and html_quote().

const String & Ssl::ErrorDetail::toString ( ) const

Definition at line 634 of file ErrorDetail.cc.

Referenced by ErrorState::Convert().

void Ssl::ErrorDetail::useRequest ( HttpRequest aRequest)

Definition at line 49 of file ErrorDetail.h.

References NULL, and request.

Referenced by ErrorState::Convert().

Member Data Documentation

Security::CertPointer Ssl::ErrorDetail::broken_cert

Definition at line 89 of file ErrorDetail.h.

Referenced by brokenCert(), ErrorDetail(), and subject().

ErrorDetailEntry Ssl::ErrorDetail::detailEntry

Definition at line 91 of file ErrorDetail.h.

Referenced by ErrorDetail().

String Ssl::ErrorDetail::errDetailStr

Definition at line 85 of file ErrorDetail.h.

Security::ErrorCode Ssl::ErrorDetail::error_no

Definition at line 86 of file ErrorDetail.h.

Referenced by ErrorDetail(), and errorNo().

Ssl::ErrorDetail::err_frm_code Ssl::ErrorDetail::ErrorFormatingCodes
Initial value:
= {
{"ssl_subject", &Ssl::ErrorDetail::subject},
{"ssl_ca_name", &Ssl::ErrorDetail::ca_name},
{"ssl_cn", &Ssl::ErrorDetail::cn},
{"ssl_notbefore", &Ssl::ErrorDetail::notbefore},
{"ssl_notafter", &Ssl::ErrorDetail::notafter},
{"ssl_error_descr", &Ssl::ErrorDetail::err_descr},
{"ssl_lib_error", &Ssl::ErrorDetail::err_lib_error},

Definition at line 71 of file ErrorDetail.h.

String Ssl::ErrorDetail::errReason

Definition at line 90 of file ErrorDetail.h.

unsigned long Ssl::ErrorDetail::lib_error_no

Definition at line 87 of file ErrorDetail.h.

Referenced by ErrorDetail(), and setLibError().

Security::CertPointer Ssl::ErrorDetail::peer_cert

Definition at line 88 of file ErrorDetail.h.

Referenced by ErrorDetail(), and peerCert().

HttpRequest::Pointer Ssl::ErrorDetail::request

Definition at line 92 of file ErrorDetail.h.

Referenced by ErrorDetail(), and useRequest().

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






Web Site Translations