我正在尝试编写一个访问 Web 服务的小应用程序,但该 Web 服务的 SSL 证书无效。我无法控制这个事实,因为它是由第三方管理的。
我已经尝试通过 IE(作为管理员和我自己的用户)访问该站点并安装证书,但它似乎并没有做太多,因为下次我浏览它时,我得到了同样的错误。
当我运行 svcutil 时,我得到以下输出:
C:\Personal>svcutil.exe https://b2b:9443/LiveFeed.svc?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'https://b2b:9443/LiveFeed.svc?wsdl' using
WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata from https://b2b:9443/LiveFeed.svc?wsdl
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: https://b2b:9443/LiveFeed.svc?wsdl
Metadata contains a reference that cannot be resolved: 'https://b2b:9443/Liv
eFeed.svc?wsdl'.
Could not establish trust relationship for the SSL/TLS secure channel with a
uthority 'b2b:9443'.
The underlying connection was closed: Could not establish trust relationship
for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.
HTTP GET Error
URI: https://b2b:9443/LiveFeed.svc?wsdl
There was an error downloading 'https://b2b:9443/LiveFeed.svc?wsdl'.
The underlying connection was closed: Could not establish trust relationship
for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.
If you would like more help, type "svcutil /?"
我知道问题与证书无效有关,但我似乎无法使证书受信任。我该怎么做呢?
到目前为止我所做的是单击错误,查看证书并安装它。我已经在 Windows 选择它自己的证书存储以及个人和受信任的存储中尝试过这个,这些都没有什么区别。
即使我设法解决了这个问题,我也担心在我的客户 PC 上安装应用程序时会遇到问题,因为我们位于两个不同的国家。
任何帮助,将不胜感激。