14#ifndef OPENVPN_SSL_TLS_CERT_PROFILE_H
15#define OPENVPN_SSL_TLS_CERT_PROFILE_H
27#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
43inline const std::string to_string(
const Type type)
49#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
66#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
67 if (profile_name ==
"insecure")
71 if (profile_name ==
"legacy")
73 else if (profile_name ==
"preferred")
75 else if (profile_name ==
"suiteb")
78 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-cert-profile: unrecognized profile name");
82 const std::string &relay_prefix)
84 const Option *o = opt.
get_ptr(relay_prefix +
"tls-cert-profile");
98 const Type orig = type;
99 if (
override.empty() ||
override ==
"default")
101#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
102 else if (
override ==
"insecure-default")
108 else if (
override ==
"legacy-default")
113 else if (
override ==
"preferred-default")
118#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
119 else if (
override ==
"insecure")
122 else if (
override ==
"legacy")
124 else if (
override ==
"preferred")
126 else if (
override ==
"suiteb")
129 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-cert-profile: 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
void apply_override(Type &type, const std::string &override)
Type default_if_undef(const Type type)
Type parse_tls_cert_profile(const std::string &profile_name)