changeset 7157:fae7cfe975fd

[gaim-migrate @ 7724] fix the NSS SSL plugin for TLS upgrades, and make note when a jabber server requires TLS upgrading. How many more acronyms can I fit in this commit message? committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 05 Oct 2003 05:35:44 +0000
parents bb484e976aa8
children aee5fd893aba
files plugins/ssl/ssl-nss.c src/protocols/jabber/auth.c
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ssl/ssl-nss.c	Sun Oct 05 05:04:55 2003 +0000
+++ b/plugins/ssl/ssl-nss.c	Sun Oct 05 05:35:44 2003 +0000
@@ -195,7 +195,8 @@
 							(void *)CERT_GetDefaultCertDB());
 	SSL_BadCertHook(nss_data->in, (SSLBadCertHandler)ssl_bad_cert, NULL);
 
-	SSL_SetURL(nss_data->in, gsc->host);
+	if(gsc->host)
+		SSL_SetURL(nss_data->in, gsc->host);
 
 	SSL_ResetHandshake(nss_data->in, PR_FALSE);
 
--- a/src/protocols/jabber/auth.c	Sun Oct 05 05:04:55 2003 +0000
+++ b/src/protocols/jabber/auth.c	Sun Oct 05 05:35:44 2003 +0000
@@ -41,11 +41,15 @@
 
 	gboolean digest_md5 = FALSE;
 
-	if(gaim_ssl_is_supported() &&
-			(starttls = xmlnode_get_child(packet, "starttls"))) {
-		jabber_send_raw(js,
-				"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
-		return;
+	if((starttls = xmlnode_get_child(packet, "starttls"))) {
+		if(gaim_ssl_is_supported()) {
+			jabber_send_raw(js,
+					"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
+			return;
+		} else if(xmlnode_get_child(starttls, "required")) {
+			gaim_connection_error(js->gc, _("Server requires SSL for login"));
+			return;
+		}
 	}
 
 	mechs = xmlnode_get_child(packet, "mechanisms");