WockyTLSHandler

WockyTLSHandler

Synopsis

void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
                                                         WockyTLSSession *tls_session,
                                                         const gchar *peername,
                                                         GStrv extra_identities,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            (*WockyTLSHandlerVerifyFinishFunc)  (WockyTLSHandler *self,
                                                         GAsyncResult *res,
                                                         GError **error);
struct              WockyTLSHandlerClass;
WockyTLSHandler *   wocky_tls_handler_new               (gboolean ignore_ssl_errors);
void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
                                                         WockyTLSSession *tls_session,
                                                         const gchar *peername,
                                                         GStrv extra_identities,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_tls_handler_verify_finish     (WockyTLSHandler *self,
                                                         GAsyncResult *result,
                                                         GError **error);
gboolean            wocky_tls_handler_add_ca            (WockyTLSHandler *self,
                                                         const gchar *path);
gboolean            wocky_tls_handler_add_crl           (WockyTLSHandler *self,
                                                         const gchar *path);
GSList *            wocky_tls_handler_get_cas           (WockyTLSHandler *self);
GSList *            wocky_tls_handler_get_crls          (WockyTLSHandler *self);
                    WockyTLSHandlerPrivate;

Description

Details

WockyTLSHandlerVerifyAsyncFunc ()

void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
                                                         WockyTLSSession *tls_session,
                                                         const gchar *peername,
                                                         GStrv extra_identities,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);


WockyTLSHandlerVerifyFinishFunc ()

gboolean            (*WockyTLSHandlerVerifyFinishFunc)  (WockyTLSHandler *self,
                                                         GAsyncResult *res,
                                                         GError **error);


struct WockyTLSHandlerClass

struct WockyTLSHandlerClass {
  WockyTLSHandlerVerifyAsyncFunc verify_async_func;
  WockyTLSHandlerVerifyFinishFunc verify_finish_func;
};

The class of a WockyTLSHandler.

WockyTLSHandlerVerifyAsyncFunc verify_async_func;

a function to call to start an asychronous verify operation; see wocky_tls_handler_verify_async() for more details

WockyTLSHandlerVerifyFinishFunc verify_finish_func;

a function to call to finish an asychronous verify operation; see wocky_tls_handler_verify_finish() for more details

wocky_tls_handler_new ()

WockyTLSHandler *   wocky_tls_handler_new               (gboolean ignore_ssl_errors);


wocky_tls_handler_verify_async ()

void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
                                                         WockyTLSSession *tls_session,
                                                         const gchar *peername,
                                                         GStrv extra_identities,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);


wocky_tls_handler_verify_finish ()

gboolean            wocky_tls_handler_verify_finish     (WockyTLSHandler *self,
                                                         GAsyncResult *result,
                                                         GError **error);


wocky_tls_handler_add_ca ()

gboolean            wocky_tls_handler_add_ca            (WockyTLSHandler *self,
                                                         const gchar *path);

Sensible default paths (under Debian derived distributions) are:

* for gnutls: /etc/ssl/certs/ca-certificates.crt * for openssl: /etc/ssl/certs

Certificates my also be found under /usr/share/ca-certificates/... if the user wishes to pick and choose which CAs to use.

self :

a WockyTLSHandler instance

path :

a path to a directory or file containing PEM encoded CA certificates

Returns :

a gboolean indicating whether the path was resolved. Does not indicate that there was actually a file or directory there or that any CAs were actually found. The CAs won't actually be loaded until just before the TLS session setup is attempted.

wocky_tls_handler_add_crl ()

gboolean            wocky_tls_handler_add_crl           (WockyTLSHandler *self,
                                                         const gchar *path);

This function does not descend subdirectories automatically.

self :

a WockyTLSHandler instance

path :

a path to a directory or file containing PEM encoded CRLs

Returns :

a gboolean indicating whether the path was resolved. Does not indicate that there was actually a file or directory there or that any CRLs were actually found. The CRLs won't actually be loaded until just before the TLS session setup is attempted.

wocky_tls_handler_get_cas ()

GSList *            wocky_tls_handler_get_cas           (WockyTLSHandler *self);


wocky_tls_handler_get_crls ()

GSList *            wocky_tls_handler_get_crls          (WockyTLSHandler *self);


WockyTLSHandlerPrivate

typedef struct _WockyTLSHandlerPrivate WockyTLSHandlerPrivate;