| libsoup Reference Manual | ||||
|---|---|---|---|---|
extern gboolean soup_ssl_supported; enum SoupSSLType; gpointer soup_ssl_get_client_credentials (const char *ca_file); void soup_ssl_free_client_credentials (gpointer creds); gpointer soup_ssl_get_server_credentials (const char *cert_file, const char *key_file); void soup_ssl_free_server_credentials (gpointer creds); GIOChannel* soup_ssl_wrap_iochannel (GIOChannel *sock, SoupSSLType type, const char *remote_host, gpointer credentials); #define SOUP_SSL_ERROR GQuark soup_ssl_error_quark (void); enum SoupSocketError;
extern gboolean soup_ssl_supported;
Can be used to test if libsoup was compiled with ssl support.
typedef enum {
SOUP_SSL_TYPE_CLIENT = 0,
SOUP_SSL_TYPE_SERVER
} SoupSSLType;
What kind of SSL connection this is.
gpointer soup_ssl_get_client_credentials (const char *ca_file);
Creates an opaque client credentials object which can later be
passed to soup_ssl_wrap_iochannel().
If ca_file is non-NULL, any certificate received from a server
must be signed by one of the CAs in the file, or an error will
be returned.
ca_file : |
path to a file containing X509-encoded Certificate Authority certificates. |
| Returns : | the client credentials, which must be freed with
soup_ssl_free_client_credentials().
|
void soup_ssl_free_client_credentials
(gpointer creds);
Frees client_creds.
creds : |
a client credentials structure returned by
soup_ssl_get_client_credentials().
|
gpointer soup_ssl_get_server_credentials (const char *cert_file, const char *key_file);
Creates an opaque server credentials object which can later be
passed to soup_ssl_wrap_iochannel().
cert_file : |
path to a file containing an X509-encoded server certificate |
key_file : |
path to a file containing an X509-encoded key for
cert_file.
|
| Returns : | the server credentials, which must be freed with
soup_ssl_free_server_credentials().
|
void soup_ssl_free_server_credentials
(gpointer creds);
Frees server_creds.
creds : |
a server credentials structure returned by
soup_ssl_get_server_credentials().
|
GIOChannel* soup_ssl_wrap_iochannel (GIOChannel *sock, SoupSSLType type, const char *remote_host, gpointer credentials);
This attempts to wrap a new GIOChannel around sock that
will SSL-encrypt/decrypt all traffic through it.
sock : |
a GIOChannel wrapping a TCP socket. |
type : |
whether this is a client or server socket |
remote_host : |
the hostname of the remote machine |
credentials : |
a client or server credentials structure |
| Returns : | an SSL-encrypting GIOChannel, or NULL on
failure.
|
GQuark soup_ssl_error_quark (void);
| Returns : | The quark used as SOUP_SSL_ERROR
|