14#ifndef OPENVPN_SSL_TLS_CERT_PROFILE_H
15#define OPENVPN_SSL_TLS_CERT_PROFILE_H
27#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
42inline const std::string to_string(
const Type type)
48#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
65#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
66 if (profile_name ==
"insecure")
70 if (profile_name ==
"legacy")
72 if (profile_name ==
"preferred")
74 if (profile_name ==
"suiteb")
76 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"tls-cert-profile: unrecognized profile name");
80 const std::string &relay_prefix)
82 const Option *o = opt.
get_ptr(relay_prefix +
"tls-cert-profile");
96 const Type orig = type;
97 if (
override.empty() ||
override ==
"default")
99#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
100 else if (
override ==
"insecure-default")
106 else if (
override ==
"legacy-default")
111 else if (
override ==
"preferred-default")
116#ifdef OPENVPN_ALLOW_INSECURE_CERTPROFILE
117 else if (
override ==
"insecure")
120 else if (
override ==
"legacy")
122 else if (
override ==
"preferred")
124 else if (
override ==
"suiteb")
127 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)