Error consuming Web Service: :SoapClient(): SSL operation failed with code 1

一曲冷凌霜 提交于 2019-12-24 00:57:02

问题


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:

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

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

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

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

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/

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.

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


回答1:


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



来源:https://stackoverflow.com/questions/18344899/error-consuming-web-service-soapclient-ssl-operation-failed-with-code-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!