Officially deprecate xmpp_conn_disable_tls()

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2023-11-01 00:09:11 +01:00
parent f40fcbe5d1
commit 69f42360cf
3 changed files with 23 additions and 21 deletions

View File

@@ -799,7 +799,8 @@ int xmpp_connect_component(xmpp_conn_t *conn,
return XMPP_EINVOP;
/* XEP-0114 does not support TLS */
xmpp_conn_disable_tls(conn);
(void)xmpp_conn_set_flags(conn, xmpp_conn_get_flags(conn) |
XMPP_CONN_FLAG_DISABLE_TLS);
if (!conn->tls_disabled) {
strophe_error(conn->ctx, "conn",
"Failed to disable TLS. "
@@ -1203,25 +1204,6 @@ int xmpp_conn_set_flags(xmpp_conn_t *conn, long flags)
return 0;
}
/** Disable TLS for this connection, called by users of the library.
* Occasionally a server will be misconfigured to send the starttls
* feature, but will not support the handshake.
*
* @param conn a Strophe connection object
*
* @note this function is deprecated
* @see xmpp_conn_set_flags()
*
* @ingroup Connections
*/
void xmpp_conn_disable_tls(xmpp_conn_t *conn)
{
long flags = xmpp_conn_get_flags(conn);
flags |= XMPP_CONN_FLAG_DISABLE_TLS;
(void)xmpp_conn_set_flags(conn, flags);
}
/** Return whether TLS session is established or not.
*
* @return TRUE if TLS session is established and FALSE otherwise

View File

@@ -255,3 +255,22 @@ void xmpp_conn_set_keepalive(xmpp_conn_t *conn, int timeout, int interval)
conn->ka_count = 0;
xmpp_conn_set_sockopt_callback(conn, xmpp_sockopt_cb_keepalive);
}
/** Disable TLS for this connection, called by users of the library.
* Occasionally a server will be misconfigured to send the starttls
* feature, but will not support the handshake.
*
* @param conn a Strophe connection object
*
* @note this function is deprecated
* @see xmpp_conn_set_flags()
*
* @ingroup Deprecated
*/
void xmpp_conn_disable_tls(xmpp_conn_t *conn)
{
long flags = xmpp_conn_get_flags(conn);
flags |= XMPP_CONN_FLAG_DISABLE_TLS;
(void)xmpp_conn_set_flags(conn, flags);
}