TLSClient: No longer calls gnutls_global_{de,}init for 3.3.0+

This commit is contained in:
Paul Beckingham 2016-11-06 01:04:36 -04:00
parent bcfebffa7f
commit 688d6b658b

View file

@ -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)