From 4365a126e370ba70ad9a2cb2533a6c5b34d3b6e2 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 26 Jun 2011 08:19:11 +0000 Subject: Use gnutls_priority_set_direct() instead of GNUTLS deprecated functions. --- src/net/tls/TLSSession.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') 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 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 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); -- cgit