00001
00002
00003
00004
00005
00006 #ifndef SSL_H
00007 #define SSL_H 1
00008
00014 #include <glib.h>
00015
00023 typedef enum {
00024 SSL_TYPE_CLIENT = 0,
00025 SSL_TYPE_SERVER
00026 } SSLType;
00027
00028 gpointer ssl_get_client_credentials (const char *ca_file);
00029 void ssl_free_client_credentials (gpointer creds);
00030 gpointer ssl_get_server_credentials (const char *cert_file,
00031 const char *key_file);
00032 void ssl_free_server_credentials (gpointer creds);
00033
00034 GIOChannel *ssl_wrap_iochannel (GIOChannel *sock,
00035 SSLType type,
00036 const char *remote_host,
00037 gpointer credentials);
00038
00039 #define SSL_ERROR ssl_error_quark()
00040
00041 GQuark ssl_error_quark (void);
00042
00043 typedef enum {
00044 SSL_ERROR_HANDSHAKE_NEEDS_READ,
00045 SSL_ERROR_HANDSHAKE_NEEDS_WRITE,
00046 SSL_ERROR_CERTIFICATE,
00047 } SocketError;
00048
00049 void ssl_cert_generate(const char *keyfile, const char *certfile,
00050 const char *cafile);
00051
00052 gpointer ssl_create_server_credentials(struct ctrlproxy_config *cfg,
00053 GKeyFile *kf, const char *group);
00054
00055 #endif