0
我正在構建WCF Restful Web服務,目前我通過http傳輸數據。現在,我想通過https安全地傳輸數據。我應該在我的配置文件中更改什麼來啓用此功能?這是我目前的配置文件:通過SSL配置REST WCF服務
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MyService.DBService" behaviorConfiguration="ServiceBehaviour">
<endpoint address ="" binding="webHttpBinding" contract="MyService.IDBService" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
是否有可能跳過IIS?現在我在我的服務器上託管WCF服務 – user1135357
對於selfhost,您將不得不使用netsh直接使用HTTP.Sys配置您的SSL證書。您可以參考這篇文章,瞭解如何使用selfhost配置SSL。 http://www.codeproject.com/Articles/24027/SSL-with-Self-hosted-WCF-Service – Praburaj