2012-12-13 67 views
1

我想使用https与自定义域公开Azure云服务,但出现错误:“请求的服务”https://mydomain.net/myservice。 svc'无法激活,请参阅服务器的诊断跟踪日志以获取更多信息。“第二个选项“A record”:在godaddy的区域文件管理器中,我为“@”主机配置了一个“记录”的A记录,该记录的“指向” myservice的“公共虚拟IP地址”(在Azure门户中找到)。在我看来,我得到“服务无法启动”的事实意味着A记录正在工作,但我不确定。使用SSL的Azure云服务的自定义域

关于https:我按照步骤http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2011/06/how-to-get-and-install-ssl-certificate.html。简而言之:我使用我的开发机器上的CSR为mydomain.net购买了一份来自godaddy的证书,使用友好名称mydomain.net在我的开发机器上完成了CSR,使用该文件将其导出到mydomain.net.pfx,上传Azure中我的云服务的证书以及在证书中配置VS中的WebRole,并将网络角色项目发布到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。

从我的搜索,我得到的印象是这对其他人的工作,我不知道我在做什么不同。

+0

你能RDP到实例,确认安装了证书和用户运行该服务有权访问私钥? – viperguynaz

+0

我不确定什么,确切地说,是必要的,以满足所述的要求,但我做了RDP,并且看到了本地计算机\个人证书和管理私钥我验证了NetworkService有权限(我也在IIS管理器中进行了验证应用程序池服务正在使用的标识是NetworkService)。该证书是否应在不同的商店?本地计算机\个人是我看到它的唯一商店(我只是想到,Azure Portal证书上传会将它放在正确的位置)。 – user1901446

+0

(不知道以上是否符合“服务可以访问私钥”的条件......如果没有,你能解释一下如何验证它吗?) – user1901446

回答

0

是的 - 您需要在服务器配置中指定的匹配端点。使用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> 
+0

你的答案有点稀疏。您是否可以添加其他信息来改进它? – ahsteele

+0

这不提供问题的答案。要批评或要求作者澄清,请在其帖子下方留言。 – ahsteele

+0

这不提供问题的答案。要批评或要求作者澄清,请在其帖子下方留言。 – ahsteele