简体   繁体   中英

WCF transport with https communication with certificates issue

I have a web application hosted in IIS on a server which communicates with a web service installed on the same server. The Web Service is installed as a standard service and not through IIS.

The service is up and running and i can navigate to it in browser using https. I added the certificate using netsh: WCF with transport security via certificates

However when the web application tries to invoke calls to the web service i get the error on the following:

An error occurred while making the HTTP request to https://TheServer/VehicleService/ConnectXml/1.0/https. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.

I looked deeper into the error and i found this:

<ExceptionType>System.IO.IOException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.</Message>
<ExceptionType>System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
 <Message>The underlying connection was closed: An unexpected error occurred on a send.</Message>

Does anyone know what could be causing the issue? Do i need to add any extra configuration to IIS?

I have tried adding the certificates locally and it works fine for me.

Your SecurityProtocolType may NOT be enabled (from Windows registry). if you also get this:

System.IO.IOException: Unable to read data from the transport connection

Try one of the following protocol types:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;   // Tls, Tls11, or Tls12

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM