Differences From Artifact [2fe019cc16]:
- File src/XMPPConnection.m — part of check-in [6a978bc7bf] at 2012-02-03 15:00:33 on branch trunk — Add missing import (user: florob@babelmonkeys.de, size: 26262) [annotate] [blame] [check-ins using]
To Artifact [4cfcab5b18]:
- File
src/XMPPConnection.m
— part of check-in
[aa0dc6e2b4]
at
2012-02-03 15:46:06
on branch trunk
— Let -[checkCertificate] return a BOOL and a reason.
Throwing an exception there was strange. (user: js, size: 26378) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
342 343 344 345 346 347 348 | } - (BOOL)streamOpen { return streamOpen; } | | > | > > > > > > > | | | | | | | | | | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | } - (BOOL)streamOpen { return streamOpen; } - (BOOL)checkCertificateAndGetReason: (OFString**)reason { X509Certificate *cert; OFDictionary *SANs; BOOL serviceSpecific = NO; @try { [sock verifyPeerCertificate]; } @catch (SSLInvalidCertificateException *e) { if (reason != NULL) *reason = [[[e reason] copy] autorelease]; return NO; } cert = [sock peerCertificate]; SANs = [cert subjectAlternativeName]; if ([[SANs objectForKey: @"otherName"] objectForKey: OID_SRVName] != nil || [SANs objectForKey: @"dNSName"] != nil || [SANs objectForKey: @"uniformResourceIdentifier"] != nil) serviceSpecific = YES; if ([cert hasSRVNameMatchingDomain: domainToASCII service: @"xmpp-client"] || [cert hasDNSNameMatchingDomain: domainToASCII]) return YES; if (!serviceSpecific && [cert hasCommonNameMatchingDomain: domainToASCII]) return YES; return NO; } - (void)sendStanza: (OFXMLElement*)element { [delegates broadcastSelector: @selector(connection:didSendElement:) withObject: self withObject: element]; |
︙ | ︙ |