Skip to content

Commit

Permalink
Bug Fix: Avatars do not display with account on a self-signed server
Browse files Browse the repository at this point in the history
Avatars do not display with matrix.org account after trusting a self-signed certificate.
Fix: reenable trusting anchor certificates in addition to those passed in via the SecTrustSetAnchorCertificates API.

element-hq/element-ios#816
  • Loading branch information
giomfo committed Jul 20, 2017
1 parent 18d4d97 commit 71119c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MatrixSDK/Utils/Media/MXMediaLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ - (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticatio
if (pinnedCertificates.count > 0)
{
SecTrustSetAnchorCertificates(protectionSpace.serverTrust, (__bridge CFArrayRef)pinnedCertificates);
// Reenable trusting anchor certificates in addition to those passed in via the SecTrustSetAnchorCertificates API.
SecTrustSetAnchorCertificatesOnly(protectionSpace.serverTrust, false);
}

SecTrustRef trust = [protectionSpace serverTrust];
Expand Down

0 comments on commit 71119c8

Please sign in to comment.