2023 commit
4e143970 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.
{
std::optional<SBuf> customFormat;
#if USE_OPENSSL
- if (const auto errorDetail = Ssl::ErrorDetailsManager::GetInstance().findDetail(error_no, request))
- customFormat = errorDetail->detail;
+ if (const auto errorDetail = Ssl::ErrorDetailsManager::GetInstance().findDetail(error_no, request)) {
+ detailEntry = *errorDetail;
+ customFormat = detailEntry->detail;
+ } else {
+ detailEntry.reset();
+ }
#else
(void)request;
#endif