Skip to content

Commit d2a59b8

Browse files
somecookiesquid-anubis
authored andcommitted
Restore Security::ErrorDetail::detailEntry initialization (#2364)
2023 commit 4e14397 accidentally removed code that was setting `detailEntry` data member, breaking `%ssl_error_descr` expansion: `Security::ErrorDetail::printErrorDescription()` would always print `[Not available]`. Squid still printed non-configurable request-independent error code _name_ correctly because the corresponding `printErrorCode()` method only uses `detailEntry` as a performance optimization. The effects of this fix are visible, for example, in generated ERR_SECURE_CONNECT_FAIL error responses: ```diff - <p>[Not available]: /CN=...</p> + <p>Certificate does not match domainname: /CN=...</p> ``` This is a Measurement Factory project.
1 parent c5f977b commit d2a59b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/security/ErrorDetail.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,12 @@ Security::ErrorDetail::verbose(const HttpRequestPointer &request) const
535535
{
536536
std::optional<SBuf> customFormat;
537537
#if USE_OPENSSL
538-
if (const auto errorDetail = Ssl::ErrorDetailsManager::GetInstance().findDetail(error_no, request))
539-
customFormat = errorDetail->detail;
538+
if (const auto errorDetail = Ssl::ErrorDetailsManager::GetInstance().findDetail(error_no, request)) {
539+
detailEntry = *errorDetail;
540+
customFormat = detailEntry->detail;
541+
} else {
542+
detailEntry.reset();
543+
}
540544
#else
541545
(void)request;
542546
#endif

0 commit comments

Comments
 (0)