internal OrganisationPortTypeClient CreatePort() { BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.Transport; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; binding.MaxReceivedMessageSize = Int32.MaxValue; binding.OpenTimeout = new TimeSpan(0, 3, 0); binding.CloseTimeout = new TimeSpan(0, 3, 0); binding.ReceiveTimeout = new TimeSpan(0, 3, 0); binding.ReceiveTimeout = new TimeSpan(0, 3, 0); binding.SendTimeout = new TimeSpan(0, 3, 0); OrganisationPortTypeClient port = new OrganisationPortTypeClient(binding, StubUtil.GetEndPointAddress("Organisation/4")); port.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindByThumbprint, registryProperties.ClientCertThumbprint); // Disable revocation checking if (registryProperties.DisableRevocationCheck) { port.ClientCredentials.ServiceCertificate.Authentication.RevocationMode = X509RevocationMode.NoCheck; } return(port); }
internal OrganisationPortTypeClient CreatePort() { BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.Transport; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; binding.MaxReceivedMessageSize = Int32.MaxValue; binding.OpenTimeout = new TimeSpan(0, 3, 0); binding.CloseTimeout = new TimeSpan(0, 3, 0); binding.ReceiveTimeout = new TimeSpan(0, 3, 0); binding.SendTimeout = new TimeSpan(0, 3, 0); OrganisationPortTypeClient port = new OrganisationPortTypeClient(binding, StubUtil.GetEndPointAddress("Organisation/5")); port.ClientCredentials.ClientCertificate.Certificate = CertificateLoader.LoadCertificateAndPrivateKeyFromFile(); // Disable revocation checking if (registryProperties.DisableRevocationCheck) { port.ClientCredentials.ServiceCertificate.Authentication.RevocationMode = X509RevocationMode.NoCheck; } return(port); }