#include <unistd.h>
#include <gnutls/gnutls.h>
-#include <tpkp_gnutls.h>
#include "giognutls.h"
gnutls_deinit(gnutls_channel->session);
- tpkp_gnutls_cleanup();
-
gnutls_certificate_free_credentials(gnutls_channel->cred);
g_free(gnutls_channel);
gpointer user_data)
{
GIOGnuTLSWatch *watch = (GIOGnuTLSWatch *) source;
- GIOFunc func = (GIOFunc) callback;
+ GIOFunc func = (GIOFunc) (void (*) (void)) callback;
GIOCondition condition = watch->pollfd.revents;
DBG("source %p condition %u", source, condition);
DBG("");
- gnutls_channel = g_new(GIOGnuTLSChannel, 1);
+ gnutls_channel = g_new0(GIOGnuTLSChannel, 1);
channel = (GIOChannel *) gnutls_channel;
"NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0:+VERS-SSL3.0:%COMPAT", NULL);
#endif
- gnutls_certificate_set_verify_function(gnutls_channel->cred, &tpkp_gnutls_verify_callback);
- /*
- * TODO: get ca-bundle path build-time configuration unless gnutls set it as a default
- */
- gnutls_certificate_set_x509_trust_file(gnutls_channel->cred, "/etc/ssl/ca-bundle.pem", GNUTLS_X509_FMT_PEM);
-
gnutls_certificate_allocate_credentials(&gnutls_channel->cred);
gnutls_credentials_set(gnutls_channel->session,
GNUTLS_CRD_CERTIFICATE, gnutls_channel->cred);