Update: Rebex HTTPS for .NET has been officially released in February 2017.
http://blog.rebex.net/https-with-tls-12-sha2-sni/
Yes, this is possible.
ASMX/WSDL generates stub objects that are inherited from System.Web.Services.Protocols.SoapHttpClientProtocol
, which provides a protected virtual WebRequest GetWebRequest(Uri uri)
method. The default implementation of that method calls System.Net.WebRequest.Create
to get an instance of WebRequest
, which means that registering our HttpRequestCreator
class with WebRequest
class as a handler for HTTP and HTTPS schemes causes the generated web service stub objects use the Rebex.Web client:
var creator = new HttpRequestCreator();
// enable TLS 1.0, 1.1 and 1.2 (and disable legacy SSL 3.0)
creator.Settings.SslAllowedVersions = TlsVersion.TLS10 | TlsVersion.TLS11 | TlsVersion.TLS12;
// register HTTP request creator to replace .NET CF's default HttpWebRequest
creator.Register();
Alternatively, you might override the stub's GetWebRequest
method to create an instance of Rebex.Web client instead of the default one:
protected override WebRequest GetWebRequest(Uri uri)
{
var creator = new HttpRequestCreator();
// enable TLS 1.0, 1.1 and 1.2 (and disable legacy SSL 3.0)
creator.Settings.SslAllowedVersions = TlsVersion.TLS10 | TlsVersion.TLS11 | TlsVersion.TLS12;
return ((IWebRequestCreate)creator).Create(uri);
}
By the way, we are going to release a new version of Rebex.Web client on Rebex Labs soon - if you would like to get informed when it's ready, please subscribe to Rebex Labs newsletter.