26#ifndef _PURPLE_SSLCONN_H_
27#define _PURPLE_SSLCONN_H_
32 PURPLE_SSL_HANDSHAKE_FAILED = 1,
33 PURPLE_SSL_CONNECT_FAILED = 2,
34 PURPLE_SSL_CERTIFICATE_INVALID = 3
40#define PURPLE_SSL_DEFAULT_PORT 443
94 gboolean (*init)(void);
138 void (*_purple_reserved2)(void);
139 void (*_purple_reserved3)(void);
140 void (*_purple_reserved4)(void);
185 int port, PurpleSslInputFunction func,
186 PurpleSslErrorFunction error_func,
209 int port, PurpleSslInputFunction func,
210 PurpleSslErrorFunction error_func,
211 const char *ssl_host,
214#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_SSLCONN_C_)
229 PurpleSslInputFunction func,
230 PurpleSslErrorFunction error_func,
249 PurpleSslInputFunction func,
250 PurpleSslErrorFunction error_func,
Public-Key Certificate API.
PurpleInputCondition
An input condition.
void purple_ssl_input_add(PurpleSslConnection *gsc, PurpleSslInputFunction func, void *data)
Adds an input watcher for the specified SSL connection.
PurpleSslConnection * purple_ssl_connect_with_ssl_cn(PurpleAccount *account, const char *host, int port, PurpleSslInputFunction func, PurpleSslErrorFunction error_func, const char *ssl_host, void *data)
Makes a SSL connection to the specified host and port, using the separate name to verify with the cer...
size_t purple_ssl_read(PurpleSslConnection *gsc, void *buffer, size_t len)
Reads data from an SSL connection.
gboolean purple_ssl_is_supported(void)
Returns whether or not SSL is currently supported.
PurpleSslErrorType
Possible SSL errors.
size_t purple_ssl_write(PurpleSslConnection *gsc, const void *buffer, size_t len)
Writes data to an SSL connection.
void purple_ssl_uninit(void)
Uninitializes the SSL subsystem.
PurpleSslOps * purple_ssl_get_ops(void)
Returns the current SSL operations structure.
PurpleSslConnection * purple_ssl_connect(PurpleAccount *account, const char *host, int port, PurpleSslInputFunction func, PurpleSslErrorFunction error_func, void *data)
Makes a SSL connection to the specified host and port.
const gchar * purple_ssl_strerror(PurpleSslErrorType error)
Returns a human-readable string for an SSL error.
void purple_ssl_set_ops(PurpleSslOps *ops)
Sets the current SSL operations structure.
void purple_ssl_init(void)
Initializes the SSL subsystem.
void purple_ssl_close(PurpleSslConnection *gsc)
Closes a SSL connection.
PurpleSslConnection * purple_ssl_connect_fd(PurpleAccount *account, int fd, PurpleSslInputFunction func, PurpleSslErrorFunction error_func, void *data)
Makes a SSL connection using an already open file descriptor.
PurpleSslConnection * purple_ssl_connect_with_host_fd(PurpleAccount *account, int fd, PurpleSslInputFunction func, PurpleSslErrorFunction error_func, const char *host, void *data)
Makes a SSL connection using an already open file descriptor.
GList * purple_ssl_get_peer_certificates(PurpleSslConnection *gsc)
Obtains the peer's presented certificates.
SSL implementation operations structure.
Structure representing an account.
A set of operations used to provide logic for verifying a Certificate's authenticity.
guint inpa
Glib event source ID; used to refer to the received data callback in the glib eventloop.
PurpleSslErrorFunction error_cb
Callback triggered if there is an error during connection.
char * host
Hostname to which the SSL connection will be made.
PurpleSslInputFunction recv_cb
User-defined callback executed when the SSL connection receives data.
PurpleSslInputFunction connect_cb
Callback triggered once the SSL handshake is complete.
void * connect_cb_data
Data to pass to PurpleSslConnection::connect_cb()
int port
Port to connect to.
void * private_data
Internal connection data managed by the SSL backend (GnuTLS/LibNSS/whatever)
int fd
File descriptor used to refer to the socket.
PurpleProxyConnectData * connect_data
Data related to the underlying TCP connection.
PurpleCertificateVerifier * verifier
Verifier to use in authenticating the peer.
void * recv_cb_data
Data passed to PurpleSslConnection::recv_cb()