Connect to https: // webservice in asp.net application

I have an ASP.NET website that accesses a web service. Everything works fine through http, but when I try https: // it cannot connect. I don't seem to see any errors on the website, and the webservice logs show nothing, which means that nothing is connected to it.

I can connect to my https: // webservice from a site like soapclient.com and request information, so web services and ports work.

Is there anything special I have to do to connect to https: // webservice through a regular http: // one in .NET? All I am doing at the moment is changing the URL to which it connects to my secure one.

I am using ASP.NET 2, IIS7

Thanks in advance.

EDIT: just found the actual error message: the underlying connection was closed: could not establish trust for the secure SSL / TLS channel. Which in my eyes tells me that I did not add my self-signed certificate to the installed certificates on the server ... but I have ...

+3
source share
2 answers

You need to add your self-signed certificate to trusted root certificate authorities in the repository of the local computer of the server running the ASP.NET website.

Export the certificate from the webservice server as a .cer file and copy it to the server running the ASP.NET website. Then on this server:

  • Double-click the .cer file and install the certificate
  • " " .
  • , IIS

: " ": http://webhelp.esri.com/arcgisserver/9.3/dotNET/index.htm#setting_up_ssl.htm

+1

, , .

(#) -, -. .NET :

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => { return true; };

, , :)

0

Source: https://habr.com/ru/post/1740750/


All Articles