35 return static_cast<int>(A) <
static_cast<int>(B);
38inline const std::string to_string(
const Type version)
58 const bool or_highest,
59 const Type max_version)
63 else if (ver ==
"1.1" &&
Type::V1_1 <= max_version)
65 else if (ver ==
"1.2" &&
Type::V1_2 <= max_version)
67 else if (ver ==
"1.3" &&
Type::V1_3 <= max_version)
72 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-version-min: unrecognized TLS version");
76 const std::string &relay_prefix,
77 const Type max_version)
79 const Option *o = opt.
get_ptr(relay_prefix +
"tls-version-min");
83 const bool or_highest = (o->
get_optional(2, 16) ==
"or-highest");
91 const Type orig = tvm;
94 if (
override.empty() ||
override ==
"default")
96 else if (
override ==
"disabled")
98 else if (
override ==
"tls_1_0")
100 else if (
override ==
"tls_1_1")
102 else if (
override ==
"tls_1_2")
104 else if (
override ==
"tls_1_3")
107 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-version-min: unrecognized override string");
const Option * get_ptr(const std::string &name) const
std::string get_optional(const size_t index, const size_t max_len) const
bool operator<(const Type &A, const Type &B)
void apply_override(Type &tvm, const std::string &override)
Type parse_tls_version_min(const std::string &ver, const bool or_highest, const Type max_version)