aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/tls_version.cpp')
-rw-r--r--src/tls/tls_version.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tls/tls_version.cpp b/src/tls/tls_version.cpp
index 30e3855e7..f451da70e 100644
--- a/src/tls/tls_version.cpp
+++ b/src/tls/tls_version.cpp
@@ -46,6 +46,17 @@ bool Protocol_Version::operator>(const Protocol_Version& other) const
return m_version > other.m_version;
}
+Protocol_Version Protocol_Version::best_known_match() const
+ {
+ if(known_version())
+ return *this; // known version is its own best match
+
+ if(is_datagram_protocol())
+ return Protocol_Version::DTLS_V12;
+ else
+ return Protocol_Version::TLS_V12;
+ }
+
bool Protocol_Version::known_version() const
{
// Don't include DTLS yet here as we can't actually process it