Web 服务作为另一个受证书保护的服务的客户端 - 第一次调用返回 403,第二次调用成功
我在 Azure 中有一个 Web 服务,我正在尝试解决在尝试将系统迁移到 IIS 7.5 时突然出现的问题。
我的网络服务在被调用时会调用另一个服务。此调用通过证书进行保护。在此通信的第一个实例中,我的连接因 403 错误而被拒绝。在第二次以及所有后续调用中,它完全按照预期工作。两次调用的代码路径是相同的,并且服务对象/客户端证书/等每次都会重新初始化。
我无法在本地重现此行为,并且它仅发生在 Web 角色初始化后的第一次调用(以及每个第一次调用)上。
我被困住了。有什么想法吗?
I've got a web service in Azure, and I'm trying to troubleshoot an issue that has only cropped up while trying to migrate the systems to IIS 7.5.
My web service, when called, makes a call to another service. This call is secured via certificate. On the first instance of this communication, my connection is denied with a 403 error. On the second, and all subsequent calls, it works exactly as intended. The code path for both calls is the same, and the service object/client certificates/etc are re-initialized each time.
I cannot reproduce this behavior locally, and it only occurs on the first call (and every first call) after initialization of the web role.
I'm stuck. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想知道该证书是否是一个转移注意力的东西,而您实际上遇到了第一个请求问题。在发出请求之前,管道不会开始侦听,但它需要请求才能开始侦听,以便您可以看到问题。
查看如何使用自动启动功能以及如何配置它,看看是否有帮助:
http://msdn.microsoft.com/en-us/library/ee677285.aspx
I wonder if the certificate is a red herring and you are in fact running into the first request problem. The pipe wont start listening until a request has been made but it needs a request to start listening so you can see the problem.
Have a look at employing the Auto Start feature and how to configure it to see if that helps:
http://msdn.microsoft.com/en-us/library/ee677285.aspx