我们想要为 Windows Azure 云中的应用程序配置 SSL。按照 windows azure 中的说明(引用:http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx),
1) 我们已从 CA(godaddy) 为我们的域 *.mydomain.com 获取了 SSL 通配符证书
2) CSR 是从托管域的 Web 服务器生成的 (mydomain.com)。这个托管域指向该 Web 服务器。
3) 为了完成证书,我们将安全证书 (.crt) 上传到托管服务器,并从该服务器导出到个人信息交换 (.pfx) 文件。 (我确信友好名称与 CN 匹配)。
4)然后我们将.pfx文件上传到windows azure webrole(云服务)中。
5) 按照说明,我们将证书指纹添加到服务配置文件中,并将证书名称设置为“MySSLCert”。
<Certificates>
<Certificate name="MySSLCert" thumbprint="1234567890" thumbprintAlgorithm="sha1" />
</Certificates>
6) 然后,我们添加了在 Azure Project 的服务定义文件中设置的 HTTPS 端点。就像,
<ServiceDefinition name="AzureSSLTest" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="SSLTestproject" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<!--<Binding name="Endpoint1" endpointName="Endpoint1" />-->
<Binding name="Endpoint2" endpointName="Endpoint2" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<!--<InputEndpoint name="Endpoint1" protocol="http" port="80" />-->
<InputEndpoint name="Endpoint2" protocol="https" port="443" certificate="MySSLCert" />
</Endpoints>
<Certificates>
<Certificate name="MySSLCert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>
发布后,当我们尝试使用 Azure 云 URL 访问应用程序时,我们收到“身份未验证”警告。(来自 Chrome 浏览器)
从 Firefox 浏览器中,我们获取错误详细信息,
testssl.cloudapp.net uses an invalid security certificate.
The certificate is only valid for the following names:
*.mydomain.com , .mydomain.com(Error code: ssl_error_bad_cert_domain)
然后,我们创建了子域(test.mydomain.com)并将该子域转发到云 URL(testssl.cloudapp.net),现在我们尝试使用托 pipe 域 URL 访问我们的应用程序,我们收到错误,
This webpage is not available
The webpage at https://testssl.cloudapp.net/ might be temporarily down or it may have moved permanently to a new web address.
Error 501 (net::ERR_INSECURE_RESPONSE): Unknown error.
请帮我解决这个问题。
最佳答案
您需要create a DNS CNAME - 您不能将屏蔽转发与Azure云服务和SSL结合使用。请参阅MSDN for reference - 特别是第 #6 项。
创建一个指向 test.iclassicmdm.com
→ testssl.cloudapp.net
的 CNAME
关于ssl - 使用 SSL 的 Azure 云服务无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16589865/