如果我将 Web 角色在 IIS 中运行,服务将按预期运行。 但是,它在 azure 模拟器中不起作用。错误页面显示“500 - 内部服务器错误。您要查找的资源有问题,无法显示。”
我怀疑这是由以下设置引起的:
<system.webServer>
<security>
<access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
</security>
</system.webServer>
但是我已经设置了一个启动任务,如下所示:
<WebRole name="WCFServiceWebRole" vmsize="ExtraSmall">
<Startup>
<Task commandLine="startup\unlockSession.cmd" executionContext="elevated" />
</Startup>
</WebRole>
其内容为:
%windir%\system32\inetsrv\appcmd unlock config /section:system.webServer/security/access
有人遇到过同样的问题吗?救命!
提前致谢!!
最佳答案
您是否在服务定义文件中启用了 SSL 端点,如下所示
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="https" port="443" certificate="SSLcertificate" />
</Endpoints> <Certificates>
<Certificate name="SSLcertificate" storeLocation="LocalMachine" storeName="My" />
</Certificates>
关于wcf - 基于 ssl 的 wcf 服务无法在 azure 模拟器中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16262782/