From 9a85c45bf729e9195b36cd955217ec336890617b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Nov 2016 01:04:36 -0400 Subject: [PATCH] TLSClient: No longer calls gnutls_global_{de,}init for 3.3.0+ --- src/TLSClient.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TLSClient.cpp b/src/TLSClient.cpp index 512de5bf1..7ad058fc7 100644 --- a/src/TLSClient.cpp +++ b/src/TLSClient.cpp @@ -86,7 +86,9 @@ TLSClient::~TLSClient () { gnutls_deinit (_session); gnutls_certificate_free_credentials (_credentials); +#if GNUTLS_VERSION_NUMBER < 0x030300 gnutls_global_deinit (); +#endif if (_socket) { @@ -144,9 +146,12 @@ void TLSClient::init ( _cert = cert; _key = key; - int ret = gnutls_global_init (); + int ret; +#if GNUTLS_VERSION_NUMBER < 0x030300 + ret = gnutls_global_init (); if (ret < 0) throw format ("TLS init error. {1}", gnutls_strerror (ret)); +#endif ret = gnutls_certificate_allocate_credentials (&_credentials); if (ret < 0)