gpt4 book ai didi

ssl - 使用 SSL 的 Azure 云服务的自定义域

转载 作者:太空宇宙 更新时间:2023-11-03 13:42:26 27 4
gpt4 key购买 nike

我尝试使用带有自定义域的 https 公开 Azure 云服务,但收到错误:“无法激活请求的服务‘https://mydomain.net/myservice.svc’。请参阅服务器的诊断跟踪日志以获取更多信息。”

关于自定义域:我已按照https://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns/#header-1中的步骤进行操作。对于第二个选项“A 记录”:在 godaddy 的区域文件管理器中,我为“@”主机配置了一条 A 记录,该主机“指向”myservice 的“公共(public)虚拟 IP 地址”(如 Azure 门户中所示)。在我看来,我得到“服务无法激活”的事实意味着 A 记录正在工作,但我不确定。

关于 https:我已按照 http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2011/06/how-to-get-and-install-ssl-certificate.html 中的步骤操作。简而言之:我使用我的开发机器上的 mydomain.net 的 CSR 从 godaddy 购买了证书,使用友好名称 mydomain.net 在我的开发机器上完成了 CSR,将其导出到 mydomain.net.pfx,使用该文件,上传将证书添加到 Azure 中的云服务,并使用该证书在 VS 中配置我的 WebRole,并将 Web 角色项目发布到 Azure。

在客户端(WP7):

<bindings>
<basicHttpBinding>
<binding name="BasicHttpsBinding_IMyInterface"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="BasicHttpsBinding_IMyInterface"
address="https://mydomain.net/myservice.svc"
contract="MyService.IMyInterface"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpsBinding_IMyInterface" />
</client>

注意:我没有使用 CName,因为我的证书不适用于子域,也不是通配符。

从我的搜索中,我得到的印象是这对其他人有效,但我不知道我在做什么不同的事情。

最佳答案

是的 - 您需要在服务器配置中指定匹配的端点。以下是使用 HTTP 传输安全性的 WCF 服务的 web.config 文件的完整示例(来自 http://msdn.microsoft.com/en-us/library/hh556232.aspx ):

<?xml version="1.0"?>
<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MySecureWCFService.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="MySecureWCFService.IService1"/>

<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

</configuration>

关于ssl - 使用 SSL 的 Azure 云服务的自定义域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13863909/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com