On April 1, 2021, we are moving all of our QuotaGuard Support Documentation to
https://quotaguard.github.io/qg-docs/
Please Update Your Support Bookmarks
Documentation for this article will be maintained at
https://quotaguard.github.io/qg-docs/quickstart-ruby
Please click on the above link to ensure you are reading
the most recent and updated documentation.
June 2019 Update : QuotaGuard is now available natively on Azure at the following link : QuotaGuard Listing on Azure.
You can also use the below directions with our direct service at : https://www.quotaguard.com.
We have had a few customers ask for help with a WCF/Azure configuration, so we will share some working code below that customers have found helpful :
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
//Wrap binding custom binding to route request through proxy with credential authentication
var customBinding = new CustomBinding(binding);
var httpElement = customBinding.Elements.Find<HttpTransportBindingElement>();
httpElement.ProxyAddress = new Uri(Environment.GetEnvironmentVariable(ProxyURL));
httpElement.ProxyAuthenticationScheme = AuthenticationSchemes.Basic;
httpElement.UseDefaultWebProxy = false;
using (var webClient = new TransparencyPlatformClient(customBinding, FinalEndpoint)
{
webClient.ClientCredentials.ClientCertificate.Certificate = Certificate;
webClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.PeerOrChainTrust;
var xmlString = XmlString(xml);
webClient.ClientCredentials.UserName.UserName = ProxyUserName;
webClient.ClientCredentials.UserName.Password = ProxyPassword;
webClient.sendMessage(YourMessage);;
}
Why is a CustomBinding used?
The pitfall is that the proxy settings on BasicHttpBinding don’t seem to be properly implemented as there is no way to get it to use the proper credentials.