WCF self-service with transport security (Authentication failed because the remote side closed the transport stream.)

I have an independent service, to which I want to add transport security. I set WSHttpBinding.SecurityMode for transport and ClientCredentialType for HttpClientCredentialType.None. I created a certificate and installed it on my host using ServiceHost.Credentials.ServiceCertificate.SetCertificate () I also registered it using netsh http add sslcert ipport = 127.0.0.1: 80 certhash = [MyCertHash] certstorename = MY appid = [TheGuidOfTheAppTertvice] verifyclientcertrevocation = disable

When I try to call the service, I get the following error message: "Authentication failed because the remote side has closed the transport stream."

Does this mean that the client and server are trying to authenticate each other? How can i turn it off? To make everything clear, I donโ€™t want to install the certificate on the client, Iโ€™m not looking for any atm authentication, I just protect the contents of the messages, if possible.

+3
source share
3 answers

This MSDN post may help solve your problem. The initial request in the message is to configure a different security mode than yours, but they will switch to transport mode for troubleshooting, and this information should apply to your situation.

, , . . !

+2

, . , WCF, - :

http://msdn.microsoft.com/en-us/library/ms733025.aspx

SVCTraceViewer , , , , WCF. 9 10 , , .

, , , .

+2

. WCF , HTTP, , - WCF.

, . , . , :

  • .

  • , , ( "localhost" Environment.MachineName)

  • The server certificate fingerprint was set by the administrator using the following command (use the netshequivalent for newer versions of Windows)

    httpcfg set ssl -i 0.0.0.0:{port} -h {thumbprint}
    
  • This client also has the same outstanding root CA certificate on the client machine.

Here's a good link: SSL with a self-serving WCF service .

+2
source

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


All Articles