|
Squid Web Cache master
|
#include <ErrorDetail.h>
Public Types | |
| typedef ErrorDetailPointer | Pointer |
Public Member Functions | |
| ErrorDetail (ErrorCode err_no, const CertPointer &peer, const CertPointer &broken, const char *aReason=nullptr) | |
| ErrorDetail (ErrorCode anErrorCode, int anIoErrorNo, int aSysErrorNo) | |
| SBuf | brief () const override |
| SBuf | verbose (const HttpRequestPointer &) const override |
| ErrorCode | errorNo () const |
| int | sysError () const |
| Certificate * | peerCert () |
| the peer certificate (or nil) | |
| Certificate * | brokenCert () |
| peer or intermediate certificate that failed validation (or nil) | |
| void | setPeerCertificate (const CertPointer &) |
| bool | equals (const ErrorDetail &other) const |
Private Types | |
| using | ErrorDetailEntry = Ssl::ErrorDetailEntry |
Private Member Functions | |
| MEMPROXY_CLASS (Security::ErrorDetail) | |
| ErrorDetail (ErrorCode err, int aSysErrorNo) | |
| helper constructor implementing the logic shared by the two public ones | |
| void | printSubject (std::ostream &os) const |
| textual representation of the subject of the broken certificate | |
| void | printCaName (std::ostream &os) const |
| the issuer of the broken certificate | |
| void | printCommonName (std::ostream &os) const |
| a list of the broken certificates CN and alternate names | |
| void | printNotBefore (std::ostream &os) const |
| textual representation of the "not before" field of the broken certificate | |
| void | printNotAfter (std::ostream &os) const |
| textual representation of the "not after" field of the broken certificate | |
| void | printErrorCode (std::ostream &os) const |
| textual representation of error_no | |
| void | printErrorDescription (std::ostream &os) const |
| short description of error_no | |
| void | printErrorLibError (std::ostream &os) const |
| textual representation of lib_error_no | |
| size_t | convertErrorCodeToDescription (const char *code, std::ostream &os) const |
Private Attributes | |
| CertPointer | peer_cert |
| A pointer to the peer certificate. | |
| CertPointer | broken_cert |
| A pointer to the broken certificate (peer or intermediate) | |
| ErrorCode | error_no = 0 |
| Squid-discovered error, validation error, or zero;. | |
| LibErrorCode | lib_error_no = 0 |
| TLS library-reported non-validation error or zero;. | |
| int | sysErrorNo = 0 |
| errno(3); system call failure code or zero | |
| int | ioErrorNo = 0 |
| std::optional< ErrorDetailEntry > | detailEntry |
| String | errReason |
| a custom reason for the error | |
Details a TLS-related error. Two kinds of errors can be detailed:
The following details may be available (only the first one is required):
Definition at line 39 of file ErrorDetail.h.
|
private |
Definition at line 117 of file ErrorDetail.h.
Definition at line 44 of file ErrorDetail.h.
| ErrorDetail::ErrorDetail | ( | ErrorCode | err_no, |
| const CertPointer & | peer, | ||
| const CertPointer & | broken, | ||
| const char * | aReason = nullptr |
||
| ) |
Details a server-side certificate verification failure. If broken is nil, then the broken certificate is the peer certificate.
Definition at line 466 of file ErrorDetail.cc.
References broken_cert, errReason, and peer_cert.
Details (or starts detailing) a non-validation failure.
| anIoErrorNo | TLS I/O function outcome; |
| aSysErrorNo | saved errno(3); |
Definition at line 475 of file ErrorDetail.cc.
References ioErrorNo.
Extract and remember errors stored internally by the TLS library.
Definition at line 445 of file ErrorDetail.cc.
References asHex(), debugs, Security::ForgetErrors(), and lib_error_no.
|
overridevirtual |
Implements ErrorDetail.
Definition at line 500 of file ErrorDetail.cc.
References asHex(), SysErrorDetail::Brief(), and SBufStream::buf().
|
inline |
Definition at line 78 of file ErrorDetail.h.
References broken_cert, and Security::LockingPointer< T, UnLocker, Locker >::get().
|
private |
Converts the code to a string value. Supported formatting 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 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
| 0 | for unsupported codes |
Definition at line 757 of file ErrorDetail.cc.
References printCaName(), printCommonName(), printErrorCode(), printErrorDescription(), printErrorLibError(), printNotAfter(), printNotBefore(), and printSubject().
|
inlineinherited |
Definition at line 44 of file Detail.h.
Referenced by Error::update().
|
inline |
Definition at line 67 of file ErrorDetail.h.
References error_no.
|
private |
|
inline |
Definition at line 75 of file ErrorDetail.h.
References Security::LockingPointer< T, UnLocker, Locker >::get(), and peer_cert.
|
private |
Definition at line 643 of file ErrorDetail.cc.
References html_quote(), and Security::IssuerName().
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 628 of file ErrorDetail.cc.
References Ssl::HasMatchingSubjectName(), and CommonNamesPrinter::printed.
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 695 of file ErrorDetail.cc.
References Security::ErrorNameFromCode().
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 709 of file ErrorDetail.cc.
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 728 of file ErrorDetail.cc.
References Security::ErrorString().
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 677 of file ErrorDetail.cc.
References Ssl::asn1timeToString(), and X509_getm_notAfter.
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 659 of file ErrorDetail.cc.
References Ssl::asn1timeToString(), and X509_getm_notBefore.
Referenced by convertErrorCodeToDescription().
|
private |
Definition at line 561 of file ErrorDetail.cc.
References html_quote(), and Security::SubjectName().
Referenced by convertErrorCodeToDescription().
| void ErrorDetail::setPeerCertificate | ( | const CertPointer & | cert | ) |
remember the SSL certificate of our peer; requires nil peerCert() unlike the cert-setting constructor, does not assume the cert is bad
Definition at line 490 of file ErrorDetail.cc.
References assert.
|
inline |
Definition at line 70 of file ErrorDetail.h.
References sysErrorNo.
Referenced by Security::PeerConnector::noteNegotiationError().
|
overridevirtual |
Implements ErrorDetail.
Definition at line 534 of file ErrorDetail.cc.
References assert, SBufStream::buf(), and Ssl::ErrorDetailsManager::GetInstance().
|
private |
Definition at line 99 of file ErrorDetail.h.
Referenced by ErrorDetail(), and brokenCert().
|
mutableprivate |
Definition at line 118 of file ErrorDetail.h.
|
private |
|
private |
Definition at line 123 of file ErrorDetail.h.
Referenced by ErrorDetail().
|
private |
OpenSSL-specific (first-level or intermediate) TLS I/O operation result reported by SSL_get_error(3SSL) (e.g., SSL_ERROR_SYSCALL) or zero. Unlike lib_error_no, this error is mostly meant for I/O control and has no OpenSSL-provided human-friendly text representation.
Definition at line 115 of file ErrorDetail.h.
Referenced by ErrorDetail().
|
private |
|
private |
Definition at line 98 of file ErrorDetail.h.
Referenced by ErrorDetail(), and peerCert().
|
private |
Definition at line 108 of file ErrorDetail.h.
Referenced by sysError().