Skip to content

Commit 8ebc6a9

Browse files
committed
Make ResolveTlsProtocolVersion() return type a typedef
1 parent 86ba556 commit 8ebc6a9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/base/tlsutility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void SetCipherListToSSLContext(const Shared<TlsContext>::Ptr& context, const Str
244244
* @param version String of a TLS version, for example "TLSv1.2".
245245
* @return The value of the corresponding TLS*_VERSION macro.
246246
*/
247-
int ResolveTlsProtocolVersion(const std::string& version) {
247+
TlsProtocolMin ResolveTlsProtocolVersion(const std::string& version) {
248248
if (version == "TLSv1.2") {
249249
return TLS1_2_VERSION;
250250
} else if (version == "TLSv1.3") {

lib/base/tlsutility.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const auto RENEW_INTERVAL = 60 * 60 * 24;
4040

4141
typedef boost::asio::ssl::context TlsContext;
4242

43+
typedef int TlsProtocolMin;
44+
4345
void InitializeOpenSSL();
4446

4547
String GetOpenSSLVersion();
@@ -48,7 +50,7 @@ void AddCRLToSSLContext(const Shared<TlsContext>::Ptr& context, const String& cr
4850
void AddCRLToSSLContext(X509_STORE *x509_store, const String& crlPath);
4951
void SetCipherListToSSLContext(const Shared<TlsContext>::Ptr& context, const String& cipherList);
5052
void SetTlsProtocolminToSSLContext(const Shared<TlsContext>::Ptr& context, const String& tlsProtocolmin);
51-
int ResolveTlsProtocolVersion(const std::string& version);
53+
TlsProtocolMin ResolveTlsProtocolVersion(const std::string& version);
5254

5355
Shared<TlsContext>::Ptr SetupSslContext(const String& certPath = String(), const String& keyPath = String(), const String& caPath = String(),
5456
const String& crlPath = String(), const String& cipherList = String(), const String& protocolmin = String(), DebugInfo di = {});

0 commit comments

Comments
 (0)