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:
James Booth
2012-05-20 01:50:32 +01:00
parent cc979d4811
commit 9615a55856
4 changed files with 21 additions and 3 deletions

View File

@@ -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];