Added option to disable TLS
The connection object includes a tls_support flag, which can be disabled with xmpp_conn_disable_tls().
This commit is contained in:
12
src/conn.c
12
src/conn.c
@@ -109,6 +109,7 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t * const ctx)
|
||||
conn->bound_jid = NULL;
|
||||
|
||||
conn->tls_support = 0;
|
||||
conn->tls_disabled = 0;
|
||||
conn->tls_failed = 0;
|
||||
conn->sasl_support = 0;
|
||||
conn->secured = 0;
|
||||
@@ -666,6 +667,17 @@ void conn_open_stream(xmpp_conn_t * const conn)
|
||||
XMPP_NS_STREAMS);
|
||||
}
|
||||
|
||||
/** Disable TLS for this connection, called by users of the library.
|
||||
* Occasionally a server will be misconfigured to send the starttls
|
||||
* feature, but wil not support the handshake.
|
||||
*
|
||||
* @param conn a Strophe connection object
|
||||
*/
|
||||
void xmpp_conn_disable_tls(xmpp_conn_t * const conn)
|
||||
{
|
||||
conn->tls_disabled = 1;
|
||||
}
|
||||
|
||||
static void _log_open_tag(xmpp_conn_t *conn, char **attrs)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
Reference in New Issue
Block a user