MonoTouch.Dialog.UrlDelegate.ReceivedAuthenticationChallenge C# (CSharp) Method

ReceivedAuthenticationChallenge() public method

public ReceivedAuthenticationChallenge ( NSUrlConnection connection, NSUrlAuthenticationChallenge challenge ) : void
connection NSUrlConnection
challenge NSUrlAuthenticationChallenge
return void
		public override void ReceivedAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge)
		{
			if (challenge.PreviousFailureCount>0){
				showError = false;
				challenge.Sender.CancelAuthenticationChallenge(challenge);
				return;
			}
			
			if (challenge.ProtectionSpace.AuthenticationMethod=="NSURLAuthenticationMethodServerTrust")
				challenge.Sender.UseCredentials(NSUrlCredential.FromTrust(challenge.ProtectionSpace.ServerTrust), challenge);
			
			
			if (challenge.ProtectionSpace.AuthenticationMethod=="NSURLAuthenticationMethodDefault" && _credential!=null) {
				challenge.Sender.UseCredentials(_credential, challenge);
			}
		}