无法让 WCF 同时使用 http 和 https 进行操作 [英] Can't get WCF to use both http and https for an operation

查看:39
本文介绍了无法让 WCF 同时使用 http 和 https 进行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 webHttpBinding 的简单 pox 操作,并指定了一种安全传输模式以启用 HTTPS.但是,一旦我这样做,我就无法再向它发送 http 流量.我想要两者的选择.如何在保持 http 的同时启用 https?

I have a simple pox operation using webHttpBinding and am specifying a security mode of transport to enable HTTPS. Once i do this though, I can no longer send http traffic to it. I'd like the option of both. How can I enable https while also keeping http?

推荐答案

您必须创建具有两个 WebHttpBinding 端点的服务.一个端点将使用 HTTP(不带传输安全的绑定),第二个端点将使用 HTTPS(带传输安全的绑定).您还必须配置您的 IIS 以支持 HTTP 和 HTTPS(分配证书).

You will have to create service with two WebHttpBinding endpoints. One endpoint will use HTTP (binding without transport security) and second endpoint will use HTTPS (binding with transport security). You will also have to configure your IIS to support both HTTP and HTTPS (assign certificate).

问题是这是否合理?如果您真的认为您的服务必须因为机密数据而提供安全传输,那么同时提供不安全的端点似乎不是一个好的解决方案.

The question is if this is reasonable? If you really think that your service has to provide secure transport because of confidental data then providing unsecured endpoint in the same time doesn't seem like a good solution.

这篇关于无法让 WCF 同时使用 http 和 https 进行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆