Thanks Lukas, It is issue on my end with the way i setup proxy, and it is working fine now.
As I mentioned above, we are relying on Rebex DLL when customer specified no proxy or HTTP proxy. If HTTPS proxy is specified, we go with out routine approach. Would you mind reviewing below code once?
public partial class ConfigurationService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
/// <summary>
/// If dock is assigned with no proxy or HTTP proxy to communicate, use Rebex DLLs.
/// If dock is assigned with HTTPS proxy, make default WebRequest.
/// </summary>
public bool UseRebex { get; set; }
//Proxy information when Rebex DLLs are being used.
public Rebex.Net.Proxy RebexProxy { get; set; }
/// <summary>
/// Overides base GetWebRequest method
/// If dock has no proxy or HTTP proxy, Rebex approach will be used.
/// If dock has HTTPS proxy, routine webrequest will be placed.
/// </summary>
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.WebRequest request = null;
if (UseRebex)
{
//Create HTTP request creator to allow only TLS1.2
HttpRequestCreator _httpRequestCreator = new HttpRequestCreator();
_httpRequestCreator.Settings.SslAllowedVersions = TlsVersion.TLS12;
_httpRequestCreator.ValidatingCertificate += CustomCertificateVerifier.CustomCertificateValidator;
//If HTTP proxy is being used, assign proxy info
if (RebexProxy != null)
_httpRequestCreator.Proxy = RebexProxy;
request = _httpRequestCreator.Create(uri);
//Preauthenticate and Credentials needs to be set for Rebex "HttpRequest"
request.PreAuthenticate = true;
request.Credentials = this.Credentials;
}
else
{
//In case of Non-Rebex approach, continue with base class behavior.
request = base.GetWebRequest(uri);
}
return request;
}
}