简体   繁体   English

与https回复端点的WCF双工连接

[英]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 我有一个带有回调的双工Wcf连接,通过http可以正常工作(当我使用<compositeDuplex clientBaseAddress="http://localhost:8678/.."/> ),但是当我尝试将该地址切换为https( "https://localhost:8678/.." ),当服务器尝试回复时,我从服务器端收到该错误

This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case 这可能是由于在HTTPS情况下未使用HTTP.SYS正确配置服务器证书的事实

Can i somehow programatically install certificate for that temp reply endpoint? 我可以以某种方式以编程方式为该临时答复端点安装证书吗? Maybe somehow create ServiceHost object and use it when i create my InstanceContext? 也许以某种方式创建ServiceHost对象并在创建InstanceContext时使用它?

When we use https protocol address to communicate with each other, we need to set up the certificate with following command. 当我们使用https协议地址相互通信时,需要使用以下命令来设置证书。

netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} 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/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 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. 如果使用Internet信息服务器(IIS)托管服务,则可以使用IIS完成该服务。 https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-configure-an-iis-hosted-wcf-service-with-ssl 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. 如果问题仍然存在,请随时告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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