summaryrefslogtreecommitdiff
blob: ac3db77c26a8bfdd563fb75134c63431c15f1bbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- libpurple/protocols/jabber/auth.c.orig	2009-06-25 19:25:47.000000000 -0400
+++ libpurple/protocols/jabber/auth.c	2009-08-31 12:01:12.000000000 -0400
@@ -691,6 +691,18 @@
 	JabberIq *iq;
 	xmlnode *query, *username;
 
+	/* We can end up here without encryption if the server doesn't support
+	 * <stream:features/> and we're not using old-style SSL.  If the user
+	 * is requiring SSL/TLS, we need to enforce it.
+	 */
+	if (!js->gsc &&
+			purple_account_get_bool(purple_connection_get_account(js->gc), "require_tls", FALSE)) {
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
+			_("You require encryption, but it is not available on this server."));
+		return;
+	}
+
 #ifdef HAVE_CYRUS_SASL
 	/* If we have Cyrus SASL, then passwords will have been set
 	 * to OPTIONAL for this protocol. So, we need to do our own