0

I need to add WCF service reference in .NET core 5.0 project on VS2019 When doing this I am getting the below error:

An error occurred while attempting to find services at 'https://ws-xxxxxx/xxxrtnerConnection?wsdl'. The request was aborted: Could not create SSL/TLS secure channel.

I have also tried below ways for solving this issue but no luck:

  1. Installed SSL certificate in in my local machine.
  2. Then I can access the service in browser.
  3. I saved/download that service in machine after that able to consume saved service using Add service reference from vs2019.
  4. When trying to access contained method inside service then getting below error:

Could not establish trust relationship for the SSL/TLS secure channel with authority 'ws-xxxxxx/xxxrtnerConnection'.

But the amazing thing is that everything is working fine when I am consuming service in MVC project after consuming it adds customBinding xml code in web.config file and there is no such file in .Net core project.

So what should I do for consuming service in .NET core project.

Rakesh
  • 329
  • 1
  • 4
  • 14
  • .NET 5 is no longer supported. See [here](https://learn.microsoft.com/en-us/lifecycle/products/microsoft-net-and-net-core) for more information. – Tu deschizi eu inchid Jul 05 '22 at 20:06
  • You can try to add a ServerCertificateValidationCallback that handles the ServicePointManager program on the client side (not a good method, but you can see if the error message disappears).`System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => { return true; };` https://stackoverflow.com/questions/1742938/how-to-solve-could-not-establish-trust-relationship-for-the-ssl-tls-secure-chan – Lan Huang Jul 06 '22 at 08:44
  • The following may be helpful: [Configuring WCF Services in Code](https://learn.microsoft.com/en-us/dotnet/framework/wcf/configuring-wcf-services-in-code), [WCF Alternatives for .NET 5](https://visualrecode.com/blog/wcf-alternatives-for-net5/), [gRPC for Windows Communication Foundation (WCF) developers](https://learn.microsoft.com/en-us/aspnet/core/grpc/why-migrate-wcf-to-dotnet-grpc?view=aspnetcore-6.0), and [https://devblogs.microsoft.com/dotnet/corewcf-v1-released/](https://devblogs.microsoft.com/dotnet/corewcf-v1-released/). – Tu deschizi eu inchid Jul 06 '22 at 14:14

0 Answers0