有没有办法强制 svcutil.exe 忽略 SSL 证书问题?
我需要 svcutil.exe 为我生成代理类,但问题是 Web 服务只能通过 HTTPS 访问,并且 SSL 证书是自签名的。
如何强制 svcutil.exe 忽略此问题?
I need svcutil.exe to generate a proxy class for me, but the problem is that the web service can be accessed only via HTTPS and the SSL certificate is self signed.
How can I force svcutil.exe to ignore this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
似乎有效的一件事是启动 Fiddler 并让它在您发出 SVCUTIL 请求时运行。 Fiddler 的证书有效并且似乎工作正常。
One thing that seemed to work was to fire up Fiddler and have it running as you make the SVCUTIL requests. Fiddler's cert is valid and seems to work fine.
+1 使用小提琴手。 您只需转到“工具”>“ Fiddler 选项并选中解密 HTTPS。
+1 for using fiddler. You just need to go to the TOOLS > Fiddler Options and check Decrypt HTTPS.
您可以尝试先浏览到 https 站点,忽略证书不受信任的警告,然后单击证书并安装它。
这应该会导致您正在使用的计算机信任该证书。
然后尝试再次运行 svcutil。
You could try browsing to the https site first, ignore the warning that the certificate is not trusted, then click on the certificate and install it.
This should result in the machine you are working on trusting the certificate.
Then try running svcutil again.
浏览到https站点,忽略警告,保存wsdl,并直接从wsdl生成客户端类
Browse to the https site, ignore the warning, save the wsdl, and generate the client class directly from the wsdl
您可以使用带有 --insecure 标志的curl 在本地下载 wsdl,然后从中生成类。
请随意修改文件名,根据需要添加开关。
You can use curl with the --insecure flag to download the wsdl locally, then generate the classes from that.
Feel free to modify file names as appropriate, adding switches as required.