Automobile.Mobile.iOS.Automation.iOSWebClient.ReceivedAuthenticationChallenge C# (CSharp) Метод

ReceivedAuthenticationChallenge() публичный Метод

Handle the auth challenge on the connection
public ReceivedAuthenticationChallenge ( NSUrlConnection connection, NSUrlAuthenticationChallenge challenge ) : void
connection NSUrlConnection
challenge NSUrlAuthenticationChallenge
Результат void
        public override void ReceivedAuthenticationChallenge(NSUrlConnection connection, NSUrlAuthenticationChallenge challenge)
        {
            if(challenge.PreviousFailureCount == 0)
            {
                var cred = NSUrlCredential.FromTrust(challenge.ProtectionSpace.ServerTrust);
                challenge.Sender.UseCredentials(cred, challenge);
            }
            else
            {
                challenge.Sender.CancelAuthenticationChallenge(challenge);
            }
        }