]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ssl/ErrorDetail.h
Detail client closures of CONNECT tunnels during TLS handshake (#691)
[thirdparty/squid.git] / src / ssl / ErrorDetail.h
CommitLineData
bbc27441 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
bbc27441
AJ
3 *
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.
7 */
8
4d16918e
CT
9#ifndef _SQUID_SSL_ERROR_DETAIL_H
10#define _SQUID_SSL_ERROR_DETAIL_H
11
83b053a0
CT
12#include "security/ErrorDetail.h"
13
14// TODO: Remove Security::X wrappers and move the remaining configurable error
15// details (i.e. templates/error-details.txt) code to src/security/ErrorDetail.
4d16918e 16
e34763f4 17namespace Ssl
4d16918e 18{
4d16918e 19/**
83f8d8f9
AJ
20 * Converts user-friendly error "name" into an Security::ErrorCode
21 * and adds it to the provided container (using emplace).
7a957a93 22 * This function can handle numeric error numbers as well as names.
4d16918e 23 */
83f8d8f9 24bool ParseErrorString(const char *name, Security::Errors &);
4d16918e 25
13cd7dee 26/// The Security::ErrorCode code of the error described by "name".
83b053a0
CT
27inline Security::ErrorCode
28GetErrorCode(const char *name)
29{
30 return Security::ErrorCodeFromName(name);
31}
02259ff8 32
1dcb1d49
CT
33/// \return string representation of a known TLS error (or a raw error code)
34/// \param prefixRawCode whether to prefix raw codes with "SSL_ERR="
83b053a0
CT
35inline const char *
36GetErrorName(const Security::ErrorCode code, const bool prefixRawCode = false)
37{
38 return Security::ErrorNameFromCode(code, prefixRawCode);
39}
4d16918e 40
13cd7dee
AJ
41/// A short description of the TLS error "value"
42const char *GetErrorDescr(Security::ErrorCode value);
cf09bec7 43
83f8d8f9 44/// \return true if the TLS error is optional and may not be supported by current squid version
645deacc
CT
45bool ErrorIsOptional(const char *name);
46
4d16918e
CT
47}//namespace Ssl
48#endif
f53969cc 49