I was able to use this answer to help me log in to my app using a client certificate.
Getting Client Certificate for Mutual Authentication with Alamofire
Everything works beautifully for log-in. Now, I need to make another request to upload a file. I used the same bit of code from the previous post to take the p12 file and create my serverTrustPolicy and add it to my session manager, but when I make the request, the server tells me that I'm not passing the certificate to them.
I do not understand why the code would work for one instance, and not another. The only difference between the two is:
Works:
manager = Alamofire.SessionManager(serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicy))
Does not work:
manager = Alamofire.SessionManager(configuration: configuration, serverTrustPolicyManager : ServerTrustPolicyManager(policies: serverTrustPolicy))
Both are using the didChallenge Delegate exactly the same.
I would appreciate any insight.