Make ResolveTlsProtocolVersion() return type a typedef

This commit is contained in:
Alexander A. Klimov 2024-07-04 10:33:02 +02:00
parent 86ba556615
commit 8ebc6a9a4c
2 changed files with 4 additions and 2 deletions

View File

@ -244,7 +244,7 @@ void SetCipherListToSSLContext(const Shared<TlsContext>::Ptr& context, const Str
* @param version String of a TLS version, for example "TLSv1.2". * @param version String of a TLS version, for example "TLSv1.2".
* @return The value of the corresponding TLS*_VERSION macro. * @return The value of the corresponding TLS*_VERSION macro.
*/ */
int ResolveTlsProtocolVersion(const std::string& version) { TlsProtocolMin ResolveTlsProtocolVersion(const std::string& version) {
if (version == "TLSv1.2") { if (version == "TLSv1.2") {
return TLS1_2_VERSION; return TLS1_2_VERSION;
} else if (version == "TLSv1.3") { } else if (version == "TLSv1.3") {

View File

@ -40,6 +40,8 @@ const auto RENEW_INTERVAL = 60 * 60 * 24;
typedef boost::asio::ssl::context TlsContext; typedef boost::asio::ssl::context TlsContext;
typedef int TlsProtocolMin;
void InitializeOpenSSL(); void InitializeOpenSSL();
String GetOpenSSLVersion(); String GetOpenSSLVersion();
@ -48,7 +50,7 @@ void AddCRLToSSLContext(const Shared<TlsContext>::Ptr& context, const String& cr
void AddCRLToSSLContext(X509_STORE *x509_store, const String& crlPath); void AddCRLToSSLContext(X509_STORE *x509_store, const String& crlPath);
void SetCipherListToSSLContext(const Shared<TlsContext>::Ptr& context, const String& cipherList); void SetCipherListToSSLContext(const Shared<TlsContext>::Ptr& context, const String& cipherList);
void SetTlsProtocolminToSSLContext(const Shared<TlsContext>::Ptr& context, const String& tlsProtocolmin); void SetTlsProtocolminToSSLContext(const Shared<TlsContext>::Ptr& context, const String& tlsProtocolmin);
int ResolveTlsProtocolVersion(const std::string& version); TlsProtocolMin ResolveTlsProtocolVersion(const std::string& version);
Shared<TlsContext>::Ptr SetupSslContext(const String& certPath = String(), const String& keyPath = String(), const String& caPath = String(), Shared<TlsContext>::Ptr SetupSslContext(const String& certPath = String(), const String& keyPath = String(), const String& caPath = String(),
const String& crlPath = String(), const String& cipherList = String(), const String& protocolmin = String(), DebugInfo di = {}); const String& crlPath = String(), const String& cipherList = String(), const String& protocolmin = String(), DebugInfo di = {});