如果 HTTP 工作正常,我是否需要执行任何特殊操作才能使 WCF 调用通过 HTTPS 工作?
我有同一个概念验证网站的两个版本: 不安全版本:
http:// www.tlsadmin.com/tlsadmin/PortalHome.aspx
和安全版本:
https: //www.tlsadmin.com/tlsadmin/PortalHome.aspx
我遇到的问题是我的基于 WCF 的 Web 服务似乎无法在 HTTPS 下工作。我有什么遗漏或不理解的吗?我认为 SVC 文件的相对 URL 将涵盖所有内容
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services>
<asp:ServiceReference Path="~/Services/Contacts.svc" />
<asp:ServiceReference Path="~/Services/Domains.svc" />
<asp:ServiceReference Path="~/Services/TreeViewNavigation.asmx" />
<asp:ServiceReference Path="/Services/FullSoaSchedulerService.svc/json" />
</Services>
</asp:ScriptManager>
也许我需要为 Web 服务添加额外的绑定才能通过 HTTPS 工作?
<service name="LC.www.nexthop.mx.POC.grid_WebService.Domains">
<endpoint address="" behaviorConfiguration="LC.www.nexthop.mx.POC.grid_WebService.DomainsAspNetAjaxBehavior"
binding="webHttpBinding" contract="LC.www.nexthop.mx.POC.grid_WebService.Domains" />
</service>
I have two versions of the same proof-of-concept site: The unsecure version:
http://www.tlsadmin.com/tlsadmin/PortalHome.aspx
and the secure version:
https://www.tlsadmin.com/tlsadmin/PortalHome.aspx
The problem I have is that my WCF-Based web services don't seem to work under HTTPS. Is there something I'm missing, or not understanding about this? I thought a relative URL for the SVC file would cover everything
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services>
<asp:ServiceReference Path="~/Services/Contacts.svc" />
<asp:ServiceReference Path="~/Services/Domains.svc" />
<asp:ServiceReference Path="~/Services/TreeViewNavigation.asmx" />
<asp:ServiceReference Path="/Services/FullSoaSchedulerService.svc/json" />
</Services>
</asp:ScriptManager>
Perhaps I need to add an additional binding for the webservice to work over HTTPS?
<service name="LC.www.nexthop.mx.POC.grid_WebService.Domains">
<endpoint address="" behaviorConfiguration="LC.www.nexthop.mx.POC.grid_WebService.DomainsAspNetAjaxBehavior"
binding="webHttpBinding" contract="LC.www.nexthop.mx.POC.grid_WebService.Domains" />
</service>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您希望将自定义绑定添加到您的配置中,通过将绑定的安全模式设置为传输来启用 HTTPS。
默认安全模式是
None
,它不能很好地与 HTTPS 配合使用。然后将该绑定分配给您的端点:
此 博客文章帮助了我。
希望这有帮助!
You want to add a custom binding to your configuration to enable it for HTTPS by setting your binding's security mode to transport.
The default security mode is
None
which doesn't play well with HTTPS.Then assign that binding to your endpoint:
This blog post helped me out when I first ran into this situation.
Hope this helps!!