OpenVPN 3 Core Library
Loading...
Searching...
No Matches
tlsver.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// OpenSSL specific methods for TLS version
13
14#pragma once
15
17
19
20inline int toTLSVersion(const Type version)
21{
22
23 switch (version)
24 {
25 case Type::UNDEF:
26 default:
27 return 0;
28 case Type::V1_0:
29 return TLS1_VERSION;
30 case Type::V1_1:
31 return TLS1_1_VERSION;
32 case Type::V1_2:
33 return TLS1_2_VERSION;
34 case Type::V1_3:
35#ifdef TLS1_3_VERSION
36 return TLS1_3_VERSION;
37#else
38 // TLS 1.3 is SSL 3.4
39 return 0x0304;
40#endif
41 }
42}
43} // namespace openvpn::TLSVersion
int toTLSVersion(const Type version)
Definition tlsver.hpp:20