wcf - 通过 Https 自托管 WCF 服务

标签 wcf ssl https hosting

我想编写一个应该使用 https 的 WCF 服务(自托管)。 通过搜索网络,我发现了一篇来自 msdn 的博客文章告诉我 使用“netsh.exe”命令将证书绑定(bind)到端点 通过命令行: http://blogs.msdn.com/b/james_osbornes_blog/archive/2010/12/10/selfhosting-a-wcf-service-over-https.aspx

然而,这仍然是最先进的吗? 为什么不使用这个: http://msdn.microsoft.com/de-de/library/system.servicemodel.description.servicecredentials.servicecertificate(v=vs.100).aspx

还是我错过了什么? 感谢您的帮助。

最佳答案

所以我终于找到了为什么需要使用netsh命令:

查看这篇文章: https://msdn.microsoft.com/en-us/library/ms789011%28v=vs.110%29.aspx

From this article: If the transport is HTTP (using the WSHttpBinding), SSL over HTTP provides the transport-level security. In that case, you must configure the computer hosting the service with an SSL certificate bound to a port, as shown later in this topic. If the transport is TCP (using the NetTcpBinding), by default the transport-level security provided is Windows security, or SSL over TCP. When using SSL over TCP, you must specify the certificate using the SetCertificate method, as shown later in this topic.

所以只能使用tcp绑定(bind)的Property。 如果使用 ssl over http,则需要通过 netsh 命令将证书绑定(bind)到端口

关于wcf - 通过 Https 自托管 WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24158884/

相关文章:

ssl - 使用 HTTPS 的 IIS 7 站点无法从外部 Internet 访问(可从 Intranet 访问)

regex - 仅匹配管理子文件夹时的 Nginx HTTPS

javascript - 我的 https 网站在 google auth 重定向到 http 后

paypal 付款完成后返回站点时出现 ssl 错误

wcf - 使用log4net或NLog的WCF日志记录/跟踪和事件ID传播

wcf - 输入验证WCF

.net - 在 WCF 应用程序中使用 MSMQ 消息时保留消息顺序

java - 试图理解 Java 中的 SSL 证书

c# - 使用跨域 WCF 服务时 OPTIONS 方法被拒绝

google-chrome - Chrome SSL 问题