Builderdash.AuthenticationRequestProxy.GetService C# (CSharp) Method

GetService() public method

public GetService ( ) : IAuthenticationRequest
return IAuthenticationRequest
        public IAuthenticationRequest GetService()
        {
            NetTcpBinding binding;
            EndpointAddress addr;

            if (_serverMode == ServerMode.Secure)
            {
                binding = GetSecureBinding();
                addr = new EndpointAddress(_uri,
                                           EndpointIdentity.CreateDnsIdentity("cn1"),
                                           (AddressHeaderCollection)null);
            }
            else
            {
                binding = GetBinding();
                addr = new EndpointAddress(_uri);
            }

            ChannelFactory<IAuthenticationRequest> factory = new ChannelFactory<IAuthenticationRequest>(binding, addr);

            factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode =
                X509CertificateValidationMode.ChainTrust;

            factory.Credentials.ServiceCertificate.Authentication.RevocationMode = X509RevocationMode.NoCheck;

            return factory.CreateChannel();
        }