]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/ErrorDetail.h
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_SSL_ERRORDETAIL_H
10 #define SQUID_SRC_SSL_ERRORDETAIL_H
12 #include "security/ErrorDetail.h"
16 // TODO: Remove Security::X wrappers and move the remaining configurable error
17 // details (i.e. templates/error-details.txt) code to src/security/ErrorDetail.
22 * Converts user-friendly error "name" into an Security::ErrorCode
23 * and adds it to the provided container (using emplace).
24 * This function can handle numeric error numbers as well as names.
26 bool ParseErrorString(const char *name
, Security::Errors
&);
28 /// The Security::ErrorCode code of the error described by "name".
29 inline Security::ErrorCode
30 GetErrorCode(const char *name
)
32 return Security::ErrorCodeFromName(name
);
35 /// \return string representation of a known TLS error (or a raw error code)
36 /// \param prefixRawCode whether to prefix raw codes with "SSL_ERR="
38 GetErrorName(const Security::ErrorCode code
, const bool prefixRawCode
= false)
40 return Security::ErrorNameFromCode(code
, prefixRawCode
);
43 /// a short description of the given TLS error known to Squid (or, if the error
44 /// is unknown, nothing)
45 std::optional
<SBuf
> GetErrorDescr(Security::ErrorCode
);
47 /// \return true if the TLS error is optional and may not be supported by current squid version
48 bool ErrorIsOptional(const char *name
);
51 #endif /* SQUID_SRC_SSL_ERRORDETAIL_H */