aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/tls/TLSSession.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2011-06-26 08:19:11 +0000
committerVincent Richard <[email protected]>2011-06-26 08:19:11 +0000
commit4365a126e370ba70ad9a2cb2533a6c5b34d3b6e2 (patch)
treef9be7b7a8f6ec490ed7d0cae93ee7980efe97d7e /src/net/tls/TLSSession.cpp
parentFixed parsing of empty body parts (thanks to John van der Kamp, from Zarafa). (diff)
downloadvmime-4365a126e370ba70ad9a2cb2533a6c5b34d3b6e2.tar.gz
vmime-4365a126e370ba70ad9a2cb2533a6c5b34d3b6e2.zip
Use gnutls_priority_set_direct() instead of GNUTLS deprecated functions.
Diffstat (limited to 'src/net/tls/TLSSession.cpp')
-rw-r--r--src/net/tls/TLSSession.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index 010c0071..af73a05c 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -123,6 +123,21 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
// Sets some default priority on the ciphers, key exchange methods,
// macs and compression methods.
+#if HAVE_GNUTLS_PRIORITY_FUNCS
+
+ if ((res = gnutls_priority_set_direct
+ (*m_gnutlsSession, "NORMAL:%SSL3_RECORD_VERSION", NULL)) != 0)
+ {
+ if ((res = gnutls_priority_set_direct
+ (*m_gnutlsSession, "NORMAL", NULL)) != 0)
+ {
+ throwTLSException
+ ("gnutls_priority_set_direct", res);
+ }
+ }
+
+#else // !HAVE_GNUTLS_PRIORITY_FUNCS
+
gnutls_set_default_priority(*m_gnutlsSession);
// Sets the priority on the certificate types supported by gnutls.
@@ -197,6 +212,8 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
gnutls_compression_set_priority(*m_gnutlsSession, compressionPriority);
+#endif // !HAVE_GNUTLS_PRIORITY_FUNCS
+
// Initialize credentials
gnutls_credentials_set(*m_gnutlsSession,
GNUTLS_CRD_ANON, g_gnutlsGlobal.anonCred);