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

@@ -209,9 +209,13 @@ static int _handle_features(xmpp_conn_t * const conn,
/* check for TLS */
if (!conn->secured) {
child = xmpp_stanza_get_child_by_name(stanza, "starttls");
if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_TLS) == 0))
conn->tls_support = 1;
if (!conn->tls_disabled) {
child = xmpp_stanza_get_child_by_name(stanza, "starttls");
if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_TLS) == 0))
conn->tls_support = 1;
} else {
conn->tls_disabled = 0;
}
}
/* check for SASL */