Fix GnuTLS >2.12 or so compatibility. Bug #779 and https://savannah.gnu.org/support/index.php?107660