Nusoap 与 https

发布于 2024-09-07 04:02:01 字数 281 浏览 2 评论 0原文

我不确定 PHP-Nusoap 客户端在向 http 和 https 发送 Web 服务请求方面是否有任何区别。对于用户测试,客户端使用 http://xxx.xxx .xxx.xxx:3833/ws/ws.svc?wsdl 工作正常。但是,当客户端使用 https 移动到生产服务器(将先前链接中的 http 替换为 https)时,我没有得到任何回复。

提前致谢

I am unsure if there is any difference for PHP-Nusoap client in sending web services request to http and https. For the user testing, the client was using http://xxx.xxx.xxx.xxx:3833/ws/ws.svc?wsdl which was working fine. However when the client moved to the production server with https (replace the http in previous link with https) I don't get any reply.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

固执像三岁 2024-09-14 04:02:01

我遇到了同样的问题,因为它在 http 上工作正常,但在 https 上却不行。只是在这里分享我的整个编程之路,以帮助其他人。

我最初遵循本教程:php webservice with nusoap and c#。他在教程中没有说的唯一一件事是,您应该将所有 php 代码放在一个 php 文件中(但是好吧,这可能真的很简单,所以对此没有真正的抱怨)。

我第一次在 http 上尝试这个,我很高兴它能工作,但后来我不得不转移到 ssl,因为我在本地服务器上测试它,所以我有一个自签名证书,然后我收到错误:“底层连接是已关闭:无法建立 SSL/TLS 安全通道的信任关系。”

我用谷歌搜索,终于在这里找到了这个链接的解决方案: damir dobric 博客基本上

,您应该添加行:

ServicePointManager.ServerCertificateValidationCallback += 
new System.Net.Security.RemoteCertificateValidationCallback(
customXertificateValidation);

并添加函数 customXertificateValidation 的实现以返回 true (这是我出于测试目的所做的)。

好吧,我确实希望这对某人有帮助,因为它让我压力了一个星期!

I had the same problem, as it was working fine on http, but wasn't on https. Just to share my whole programming path here, to help others.

I originally followed this tutorial: php webservice with nusoap and c#. Only thing he doesn't say in the tutorial is that you should put all the php code in one php file (but ok, it might be just straightforward really, so no real complaints on that one).

I first tried this on http, and I was happy it worked, but later I had to move to ssl, and since I was testing it on my local server I had a selfsigned certificate, and I got the error: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

I googled and finally found the solution on this link here: damir dobric blog

Basically you should add the line:

ServicePointManager.ServerCertificateValidationCallback += 
new System.Net.Security.RemoteCertificateValidationCallback(
customXertificateValidation);

and add the implementation of the function customXertificateValidation to return true (this is what I did for testing purposes).

Ok, I do hope this helps someone, cause it got me stressed for a week!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文