From bb20f20beeb9daa8fff13972fc043fc40c161ca0 Mon Sep 17 00:00:00 2001 From: Russell Hancox Date: Tue, 19 Jul 2016 14:31:42 -0400 Subject: [PATCH] v1.7 --- MOLAuthenticatingURLSession.podspec | 2 +- Source/MOLAuthenticatingURLSession.m | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MOLAuthenticatingURLSession.podspec b/MOLAuthenticatingURLSession.podspec index 2402dd4..65fe701 100644 --- a/MOLAuthenticatingURLSession.podspec +++ b/MOLAuthenticatingURLSession.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MOLAuthenticatingURLSession' - s.version = '1.5' + s.version = '1.7' s.platform = :osx s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } s.homepage = 'https://github.com/google/macops-molauthenticatingurlsession' diff --git a/Source/MOLAuthenticatingURLSession.m b/Source/MOLAuthenticatingURLSession.m index a0bf905..14f736f 100644 --- a/Source/MOLAuthenticatingURLSession.m +++ b/Source/MOLAuthenticatingURLSession.m @@ -214,6 +214,11 @@ - (NSURLCredential *)clientCredentialForProtectionSpace:(NSURLProtectionSpace *) } if (foundIdentity) { + SecCertificateRef certificate = NULL; + SecIdentityCopyCertificate(foundIdentity, &certificate); + MOLCertificate *clientCert = [[MOLCertificate alloc] initWithSecCertificateRef:certificate]; + if (certificate) CFRelease(certificate); + if (clientCert) [self log:@"Client Trust: %@", clientCert]; NSURLCredential *cred = [NSURLCredential credentialWithIdentity:foundIdentity certificates:nil @@ -281,7 +286,7 @@ - (NSURLCredential *)serverCredentialForProtectionSpace:(NSURLProtectionSpace *) SecCertificateRef firstCert = SecTrustGetCertificateAtIndex(serverTrust, 0); if (firstCert) { MOLCertificate *cert = [[MOLCertificate alloc] initWithSecCertificateRef:firstCert]; - [self log:@"Server Trust: Server leaf cert: %@", cert]; + [self log:@"Server Trust: %@", cert]; } // Evaluate the server's cert chain.