Forum Discussion

spoguys's avatar
spoguys
Copper Contributor
Sep 05, 2024

How can I connect to web services (ASMX) over HTTPS from a Windows application?

We have an old web service (CustomWebService.asmx) that was created many years ago, and we have a custom Windows application installed on each user's laptop, which consumes CustomWebService.asmx via HTTP.

 

Recently, we upgraded from HTTP to HTTPS, and then we realized that the Windows application cannot create an SSL/TLS secure channel to communicate with CustomWebService.asmx. However, connecting to the web services on MS Edge over HTTPS works well. Here is the code:

 

WebReferenceToWebService.CustomWebService websvc = new WebReferenceToWebService.CustomWebService();
websvc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
websvc.PreAuthenticate = true;
websvc.Url = _strWebUrl;
DataSet result = websvc.GetData();

 

 

Here is the exception stack:

The request was aborted: Could not create SSL/TLS secure channel. 
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)


The code is currently running on .NET Framework 4.


Can you please advise on how to make the custom window application requests communicate with CustomWebService.asmx over HTTPS? Thanks a lot!!!

 

No RepliesBe the first to reply

Resources