【发布时间】:2022-09-23 15:33:03
【问题描述】:
我正在努力将部署在服务器上的 Windows 服务从 HTTP 传递到 HTTPS。
我们应该如何着手?
<system.serviceModel>
<!--Conf HTTP-->
<client>
<endpoint address=\"http://localhost/WorkflowsService\"
binding=\"customBinding\" bindingConfiguration=\"UserNameOverTransportBindingConfiguration\"
contract=\"OmmoComponents.Workflows.Common.Contracts.IWorkflowsService\"
name=\"WorkflowsServiceEndPoint\"/>
<endpoint address=\"http://localhost/OMVGestionService\" binding=\"customBinding\"
bindingConfiguration=\"UserNameOverTransportBindingConfiguration\"
contract=\"OmmoOMV.Gestions.Common.Contracts.IOMVGestionService\"
name=\"OMVGestionServiceEndPoint\" />
<endpoint address=\"http://localhost/OMVControlesService\" binding=\"customBinding\"
bindingConfiguration=\"UserNameOverTransportBindingConfiguration\"
contract=\"OmmoOMV.Controles.Common.Contracts.IOMVControlesService\"
name=\"OMVControleServiceEndPoint\" />
<endpoint address=\"http://localhost/OMVFacturationService\" binding=\"customBinding\"
bindingConfiguration=\"UserNameOverTransportBindingConfiguration\"
contract=\"OmmoOMV.Facturation.Common.Contracts.IOMVFacturationService\"
name=\"OMVFacturationService\" />
<endpoint address=\"http://localhost/SecurityServices\" binding=\"customBinding\"
bindingConfiguration=\"DefaultBindingConfiguration\" contract=\"OmmoComponents.Security.Common.Contracts.ISecurityServices\"
name=\"SecurityServicesEndPoint\" />
</client>
</system.serviceModel>
我使用新的基地址为 HTTPS Windows 服务添加了一个新的端点配置,以便复制现有配置
<service name=\"EntityManagementService\">
<endpoint address=\"\"
binding=\"customBinding\"
bindingConfiguration=\"UserNameOverTransportBindingConfiguration\"
contract=\"OmmoComponents.EntityManagement.Common.Contracts.IEntityManagementService\"
name=\"EntityManagementServiceEndPoint\" />
<endpoint address=\"\"
binding=\"customBinding\"
bindingConfiguration=\"UserNameOverTransportBindingConfigurationExt\"
contract=\"OmmoComponents.EntityManagement.Common.Contracts.IEntityManagementService\"
name=\"EntityManagementServiceExtEndPoint\" />
<host>
<baseAddresses>
<add baseAddress=\"http://localhost:7190/EntityManagementService\" />
<add baseAddress=\"https://localhost:7191/EntityManagementService\" />
</baseAddresses>
</host>
</service>
-
我复制现有配置并使用 HTTPS 进行更改。请看我最近的修改