adium 4050:324eaebc242a: Reverted 3916:28489468e04c, use workaro...

commits at adium.im commits at adium.im
Wed Jul 13 09:36:02 UTC 2011


details:	http://hg.adium.im/adium/rev/324eaebc242a
revision:	4050:324eaebc242a
branch:		(none)
author:		Patrick Steinhardt <steinhardt.p at me.com>
date:		Wed Jul 13 11:35:45 2011 +0200

Reverted 3916:28489468e04c, use workaround only if "Force old-style SSL" is disabled.

diffs (27 lines):

diff -r 6815686d7b2f -r 324eaebc242a Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m
--- a/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m	Wed Jul 13 10:45:56 2011 +0200
+++ b/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m	Wed Jul 13 11:35:45 2011 +0200
@@ -51,6 +51,23 @@
 							 resultCallback:(void (*)(gboolean trusted, void *userdata))_query_cert_cb
 								   userData:(void*)ud
 {
+	if ([hostname caseInsensitiveCompare:@"talk.google.com"] == NSOrderedSame &&
+		![[account preferenceForKey:KEY_JABBER_FORCE_OLD_SSL group:GROUP_ACCOUNT_STATUS] boolValue]) {
+		NSString *UID = account.UID;
+		NSRange startOfDomain = [UID rangeOfString:@"@"];
+
+		if (startOfDomain.location == NSNotFound ||
+			([[UID substringFromIndex:NSMaxRange(startOfDomain)] caseInsensitiveCompare:@"gmail.com"] == NSOrderedSame)) {
+			/* Google Talk accounts end up with a cert signed using gmail.com as the server.
+			 * However, Google For Domains accounts are signed using talk.google.com
+			 */
+			hostname = @"gmail.com";
+		} else if ([[UID substringFromIndex:NSMaxRange(startOfDomain)] caseInsensitiveCompare:@"googlemail.com"] == NSOrderedSame) {
+			/* There are three certificates, as far as I (am) know. Maybe we should ask Sean for confirmation. */
+			hostname = @"googlemail.com";
+		}
+	}
+
 	AIPurpleCertificateTrustWarningAlert *alert = [[self alloc] initWithAccount:account hostname:hostname certificates:certs resultCallback:_query_cert_cb userData:ud];
 	[alert showWindow:nil];
 	[alert release];




More information about the commits mailing list