库与 OpenSSL 和 PHP 5.3.3 冲突?

发布于 2024-12-17 19:03:52 字数 1465 浏览 2 评论 0原文

我正在尝试在我的 Web 应用程序中实现基于 PHP SOAP 的 Web 服务。我收到一系列错误,这些错误似乎表明与 OpenSSL(或 Curl 等)有关的库存在冲突,我通过在互联网上搜索类似错误来理解这一点,但认为普遍的共识是库是问题所在,我找不到解决方案。

Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: SSL operation failed with code 1. OpenSSL Error messages:
error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: Failed to enable crypto [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: connect() failed: Unspecified error [CORE/vendors/Startrack/WSSecurity.php, line 110]
Notice (8): Undefined property: SoapFault::$detail [APP/controllers/startrack_controller.php, line 38]
Notice (8): Trying to get property of non-object [APP/controllers/startrack_controller.php, line 38]

Could not connect to host

这是由 Mac OSX Lion 服务器提供的。安装 PHP 5.3.3,并启用 OpenSSL、Curl 和 SOAP 扩展。这是在 CakePHP 中构建的,它解释了上面错误消息的语法。我正在使用已提供的 PHP Web 服务包。当通过 MAMP 托管时,上述内容有效,但我希望不必依赖 MAMP。

我能发现的唯一不兼容性是 OpenSSL 标头和库版本之间的不兼容性,但据我所知,这应该不是问题?

OpenSSL Library Version OpenSSL 0.9.8r 8 Feb 2011
OpenSSL Header Version  OpenSSL 0.9.8l 5 Nov 2009

我想了解假定的“冲突”是否发生在我的服务器和远程服务器之间? WSDL 文件包含在 Web 服务 API 中,因为他们希望避免出现任何问题,并且它通过在同一台计算机上安装 MAMP 来工作。所以我认为这是 Apache/PHP 和 Curl/OpenSSL 之间的设置问题。

任何关于如何确定实际问题并纠正它的指示将不胜感激。

I am trying to implement a PHP SOAP based web service into my web application. I am getting a series of errors which seem to point to a conflict of libraries with regard to OpenSSL (or Curl, etc.), this I have understood by searching the internet for similar errors, but thought a general consensus that libraries are the issue, there is no solution that I can find.

Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: SSL operation failed with code 1. OpenSSL Error messages:
error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: Failed to enable crypto [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: connect() failed: Unspecified error [CORE/vendors/Startrack/WSSecurity.php, line 110]
Notice (8): Undefined property: SoapFault::$detail [APP/controllers/startrack_controller.php, line 38]
Notice (8): Trying to get property of non-object [APP/controllers/startrack_controller.php, line 38]

Could not connect to host

This is being served from a Mac OSX Lion server. PHP 5.3.3 is installed, and the extensions for OpenSSL, Curl and SOAP are enabled. This is being built within CakePHP which explains the syntax of the error messages above. I am using a PHP Web Service bundle already provided. The above works when hosted via MAMP, but I am hoping to not have to rely on MAMP.

The only incompatibility I can find is between the OpenSSL headers and library versions, but from what I know this ought not be a problem?

OpenSSL Library Version OpenSSL 0.9.8r 8 Feb 2011
OpenSSL Header Version  OpenSSL 0.9.8l 5 Nov 2009

I am trying to understand if the assumed 'conflict' is between my server and the remote server? The WSDL file is included in the Web Service API, as they hope to avoid any issues, and it works through a MAMP install on the same computer. So I think it is a setup issue between Apache/PHP and Curl/OpenSSL.

Any pointers to how to establish the actual issue, and rectify it would be appreciated.

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

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

发布评论

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

评论(1

染火枫林 2024-12-24 19:03:52

这可能是因为您正在尝试连接启用了 SSL 3 的服务器,该服务器可能(?)禁用了 SSL 2。

尝试在命令行上像这样连接到服务器:

 openssl s_client -connect {SERVER NAME OR IP}:443 -state

如果这不起作用,那么尝试像这样连接:

 openssl s_client -ssl3 -connect {SERVER NAME OR IP}:443 -state

如果这确实有效,那么尝试创建一个包装类,类似于 这一内容可在 PHP 文档中找到

您应该在 callCurl 函数内添加类似于以下内容的行,

 curl_setopt($handle, CURLOPT_SSLVERSION, 3);

以强制 SOAP 通过 ssl 版本 3 进行连接。

This could be because you are trying to connect with an SSL 3 enabled server, that may (?) have SSL 2 disabled.

Try connecting to the server like this on the command line:

 openssl s_client -connect {SERVER NAME OR IP}:443 -state

If that does not work, then try connecting like this:

 openssl s_client -ssl3 -connect {SERVER NAME OR IP}:443 -state

If that does work, then try creating a wrapper class, similar to this one found in the PHP documentation.

You should add a line similar to:

 curl_setopt($handle, CURLOPT_SSLVERSION, 3);

inside the callCurl function to force SOAP to connect over version three of ssl.

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