Skip to content

Commit

Permalink
v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
russellhancox committed Jul 19, 2016
1 parent 6ffcdd9 commit bb20f20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MOLAuthenticatingURLSession.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
7 changes: 6 additions & 1 deletion Source/MOLAuthenticatingURLSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit bb20f20

Please sign in to comment.