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)
71 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-version-min: unrecognized TLS version");
75 const std::string &relay_prefix,
76 const Type max_version)
78 const Option *o = opt.
get_ptr(relay_prefix +
"tls-version-min");
82 const bool or_highest = (o->
get_optional(2, 16) ==
"or-highest");
90 const Type orig = tvm;
93 if (
override.empty() ||
override ==
"default")
95 else if (
override ==
"disabled")
97 else if (
override ==
"tls_1_0")
99 else if (
override ==
"tls_1_1")
101 else if (
override ==
"tls_1_2")
103 else if (
override ==
"tls_1_3")
106 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)