我有一个Web应用程序,其中一个进程需要在外部服务器中调用https web服务。
当我打电话时,我得到一个例外:An error occurred while making the HTTP request to https://servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.
内部的例外是:The underlying connection was closed: An unexpected error occurred on a send.
为了进行调试,我创建了一个windows窗体应用程序,它使用完全相同的代码,执行完全相同的调用,并为调用访问相同的证书。但是在windows窗体应用程序上,调用没有问题。
我不知道什么会导致IIS内部的连接失败,也不知道两者之间有什么不同。
发布于 2015-04-29 18:05:21
我找出了问题,并设法找到了解决办法。
问题是,代码使用的是记录用户可以访问但IIS没有访问的证书。为了以IIS可以访问的方式安装证书,您需要:
https://stackoverflow.com/questions/29829386
复制相似问题