简体   繁体   中英

Wcf duplex connection with https reply endpoint

I have a duplex Wcf connection with callback, which works ok via http, (when i use <compositeDuplex clientBaseAddress="http://localhost:8678/.."/> ), but when i try to switch that adress to https ( "https://localhost:8678/.." ), i get that error from the server side when it's trying to reply

This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case

Can i somehow programatically install certificate for that temp reply endpoint? Maybe somehow create ServiceHost object and use it when i create my InstanceContext?

When we use https protocol address to communicate with each other, we need to set up the certificate with following command.

netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF}

Here are the official details.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-configure-a-port-with-an-ssl-certificate
https://docs.microsoft.com/en-us/windows/desktop/http/add-sslcert
If you host the service with internet information server (IIS), you could complete this with IIS. https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-configure-an-iis-hosted-wcf-service-with-ssl
Feel free to let me know if the problem still exists.

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