本文介绍了消耗错误的Web服务::SoapClient():SSL操作失败,代码为1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Web服务,我的朋友在Windows 7中使用xampp进行了测试,并且正在工作.他告诉我他安装了一个自签名证书.但是我被卡住了,我得到了这个错误:

I'm trying to consume a Web Services, my friend tested in windows 7 with xampp and is working. He told me he installed a self-signed certificate.But i'm stuck, i get this error:

警告:SoapClient :: SoapClient():SSL操作失败,代码为1.OpenSSL错误消息:错误:1408F119:SSL例程:SSL3_GET_RECORD:解密失败或在第51行的/var/www/project/lib/Zend/Soap/Client/Common.php中记录Mac的错误记录

Warning: SoapClient::SoapClient(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac in /var/www/project/lib/Zend/Soap/Client/Common.php on line 51

警告:SoapClient :: SoapClient():无法在第51行的/var/www/project/lib/Zend/Soap/Client/Common.php中启用加密功能

Warning: SoapClient::SoapClient(): Failed to enable crypto in /var/www/project/lib/Zend/Soap/Client/Common.php on line 51

警告:SoapClient :: SoapClient( https://url.com/webservice?wsdl ):无法打开流:在第51行的/var/www/eph_me_113/lib/Zend/Soap/Client/Common.php中操作失败

Warning: SoapClient::SoapClient(https://url.com/webservice?wsdl): failed to open stream: operation failed in /var/www/eph_me_113/lib/Zend/Soap/Client/Common.php on line 51

警告:SoapClient :: SoapClient():I/O警告:无法加载外部实体" https ://url.com/webservice?wsdl& quot ;在第51行的/var/www/eph_me_113/lib/Zend/Soap/Client/Common.php中

Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "https://url.com/webservice?wsdl" in /var/www/eph_me_113/lib/Zend/Soap/Client/Common.php on line 51

我曾尝试使用certutils工具在计算机中安装.cert:

I been tried installing the .cert in my machine with the certutils tools like this:

http://blog.avirtualhome.com /adding-ssl-certificates-to-google-chrome-linux-ubuntu/

之后,我在浏览器中看到了wsdl,没有红页警告.浏览器告诉我,现在实体有效".但是我仍然遇到相同的错误.

After that i see the wsdl in the browser without the red page warning. The browsers tellme that now the "entity is valid". But i'm still having the same error.

我也尝试将其添加到客户端中.

I also try adding this in my client.

$opts = array(
        'ssl'   => array(
                'verify_peer'          => false,
                'allow_self-signed' => true,
                'ciphers' => "SHA1"
            )
        );
        $streamContext = stream_context_create($opts);

$params = array(
            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
            'stream_context'     => $streamContext,
            'cache_wsdl' => NULL,
        );

$client = new SoapClient($url, $params);

我很困在这里,所以,我希望有人能帮助我.

I'm very stuck here, so, i hope someone can help me.

注意:我正在使用openssl 1.0.1e和Debian 7.

Note: I'm using openssl 1.0.1e and Debian 7.

推荐答案

如果碰巧有更高版本,请尝试降级到PHP 5.3

Try downgrading to PHP 5.3 if you happen to have a higher version

这篇关于消耗错误的Web服务::SoapClient():SSL操作失败,代码为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 05:56