LOG(LOG_ERROR,
"initialize_tls_session_client(): can't read CA file: '%s'",
PROXY_CA_FILE);
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
/* And certificate for this website and proxy's private key. */
"initialize_tls_session_client(): \
can't read server certificate ('%s') or key file ('%s'): %s",
path, PROXY_KEY_FILE, gnutls_strerror(result));
+ gnutls_certificate_free_credentials(*x509_cred);
/* Could be a missing certificate. */
return -2;
}
LOG(LOG_ERROR,
"initialize_tls_session_client(): gnutls_init(): %s",
gnutls_strerror(result));
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
result = gnutls_priority_set(*session, tls_priority_cache);
LOG(LOG_ERROR,
"initialize_tls_session_client(): gnutls_priority_set(): %s",
gnutls_strerror(result));
+ gnutls_deinit(*session);
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
result = gnutls_credentials_set(*session,
LOG(LOG_ERROR,
"initialize_tls_session_client(): gnutls_credentials_set(): %s",
gnutls_strerror(result));
+ gnutls_deinit(*session);
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
LOG(LOG_ERROR,
"initialize_tls_session_server(): gnutls_init(): %s",
gnutls_strerror(result));
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
gnutls_priority_set(*session, tls_priority_cache);
LOG(LOG_ERROR,
"initialize_tls_session_server(): gnutls_priority_set(): %s",
gnutls_strerror(result));
+ gnutls_deinit(*session);
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}
result = gnutls_credentials_set(*session,
LOG(LOG_ERROR,
"initialize_tls_session_server(): gnutls_credentials_set(): %s",
gnutls_strerror(result));
+ gnutls_deinit(*session);
+ gnutls_certificate_free_credentials(*x509_cred);
return -1;
}