Top |
LmSSLResponse | (*LmSSLFunction) () |
LmSSL * | lm_ssl_new () |
gboolean | lm_ssl_is_supported () |
const gchar * | lm_ssl_get_fingerprint () |
void | lm_ssl_set_ca () |
void | lm_ssl_set_cipher_list () |
LmSSL * | lm_ssl_ref () |
void | lm_ssl_unref () |
Use this together with an LmConnection to get the connection to use SSL. Example of how to use the LmSSL API.
1 2 3 4 5 6 7 |
LmConnection *connection; LmSSL *ssl; connection = lm_connection_new ("myserver"); ssl = lm_ssl_new (NULL, my_ssl_func, NULL, NULL); lm_connection_set_ssl (connection, ssl); ... |
LmSSLResponse (*LmSSLFunction) (LmSSL *ssl
,LmSSLStatus status
,gpointer user_data
);
This function is called if something goes wrong during the connecting phase.
ssl |
An LmSSL. |
|
status |
The status informing what went wrong. |
|
user_data |
User data provided in the callback. |
User should return LM_SSL_RESPONSE_CONTINUE if connection should proceed and otherwise LM_SSL_RESPONSE_STOP.
LmSSL * lm_ssl_new (const gchar *expected_fingerprint
,LmSSLFunction ssl_function
,gpointer user_data
,GDestroyNotify notify
);
Creates a new SSL struct, call lm_connection_set_ssl to use it.
expected_fingerprint |
The expected fingerprint. |
|
ssl_function |
Callback called to inform the user of a problem during setting up the SSL connection and how to proceed. If |
|
user_data |
Data sent with the callback. |
|
notify |
Function to free |
gboolean
lm_ssl_is_supported (void
);
Checks whether Loudmouth supports SSL or not.
const gchar *
lm_ssl_get_fingerprint (LmSSL *ssl
);
Returns the fingerprint of the remote server's certificate.
void lm_ssl_set_ca (LmSSL *ssl
,const gchar *ca_path
);
Sets a path to certificates which should be trusted.
void lm_ssl_set_cipher_list (LmSSL *ssl
,const gchar *cipher_list
);
Sets the list of availeble ciphers.
typedef struct _LmSSL LmSSL;
This should not be accessed directly. Use the accessor functions as described below.
Provides information about something gone wrong when trying to setup the SSL connection.
Used to inform LmConnection if you want to stop due to an error reported or if you want to continue to connect.