soup-ssl 3 LIBSOUP Library
soup-ssl

## Synopsis

    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);

## Description

## Details

### enum SoupSSLType

    typedef enum {
    	SOUP_SSL_TYPE_CLIENT = 0,
    	SOUP_SSL_TYPE_SERVER
    } SoupSSLType;

What kind of SSL connection this is.

`SOUP_SSL_TYPE_CLIENT`

  the client side of an SSL connection

`SOUP_SSL_TYPE_SERVER`

  the server side of an SSL connection

SoupSSLType

### soup_ssl_get_client_credentials ()

    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()`.

soup_ssl_get_client_credentials

### soup_ssl_free_client_credentials ()

    void        soup_ssl_free_client_credentials
                                                (gpointer creds);

Frees client_creds.

creds :

soup_ssl_free_client_credentials

### soup_ssl_get_server_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()`.

soup_ssl_get_server_credentials

### soup_ssl_free_server_credentials ()

    void        soup_ssl_free_server_credentials
                                                (gpointer creds);

Frees server_creds.

creds :

soup_ssl_free_server_credentials

### soup_ssl_wrap_iochannel ()

    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 :

credentials :

Returns :

  an SSL-encrypting GIOChannel, or `NULL` on failure.

soup_ssl_wrap_iochannel