Bug #68017 [Com]: SoapServer fails to load local wsdl when using ssl

From: Date: Tue, 01 Mar 2016 08:34:09 +0000
Subject: Bug #68017 [Com]: SoapServer fails to load local wsdl when using ssl
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199544@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68017&edit=1 ID: 68017 Comment by: marko at techytalk dot info Reported by: dallas at ekkysoftware dot com Summary: SoapServer fails to load local wsdl when using ssl Status: Not a bug Type: Bug Package: OpenSSL related Operating System: CentOS PHP Version: 5.5.16 Block user comment: N Private report: N New Comment: Hi guys, we had the exact same issue with stock Magento SOAP server implementation when someone set: default_socket_timeout = -1 in our php.ini (Centos). It goes away with any other value there, so pretty much reproducible. Previous Comments: ------------------------------------------------------------------------ [2015-03-05 03:53:52] dallas at ekkysoftware dot com Hello Daniel, I guess that I've been writing software for a lot longer than you. If this was caused by the server been miss-configured, then it would be a problem for all other connection via SSL. For example a browser. But all other connection such as wget works correctly, except the cURL request from the SoapServer. If you search the web, you'll find a number of other people who have the same problem as I and have had to remove the https from the wsdl to solve the problem. ------------------------------------------------------------------------ [2015-03-04 21:13:26] rdlowrey@php.net Your SSL context settings are totally wrong and demonstrate a blind "shot in the dark." Unfortunately we can't help you with broken userland code support. If you can demonstrate a reproducible problem with correct userland code I will be happy to look into it. In the meantime, I recommend posting a question on stackoverflow.com to get help with how to correctly configure your SSL context options. I'm closing this until a valid reproducible test case is shown to fail. ------------------------------------------------------------------------ [2014-09-13 08:26:58] dallas at ekkysoftware dot com Description: ------------ When connecting to a soapclient to a soapserver via ssl. Everything works correctly when over http, but when moving to https it all fails. It was working when the ssl certificate/host was the default and did not require a SNI. Additionally if we flip the wsdl on the server side to http, then the client can connect sometimes - intermittent. wget and curl are both able to access the wsdl via https and I can copy the wsdl to a local file and the SoapServer will still not load from a local file. Server is setup as a virtual host where the host is not the default. When it was the default, the soap connection work correctly via https. Best guess is something is connection over ssl with ip 127.0.0.1, without an SNI and is getting the wrong certificate, preventing successful connection. Test script: --------------- I have tried all the options such as: $context = stream_context_create(array( 'ssl' => array('SNI_server_name' => parse_url($this->_wsdl, PHP_URL_HOST),'SNI_enabled' => TRUE, 'peer_name' => parse_url($this->_wsdl, PHP_URL_HOST),'verify_peer' => false, 'allow_self_signed' => true), )); $options['stream_context'] = $context; $options['ssl'] = array('ciphers'=> "SHA1",'verify_peer' => false, 'allow_self_signed' => true, 'peer_name' => parse_url($this->_wsdl, PHP_URL_HOST),'curl_verify_ssl_peer'=>false,'curl_verify_ssl_host' => false); $options['https'] = array('ciphers'=> "SHA1",'verify_peer' => false, 'allow_self_signed' => true, 'peer_name' => parse_url($this->_wsdl, PHP_URL_HOST),'curl_verify_ssl_peer'=>false,'curl_verify_ssl_host' => false); $server = new SoapServer($this->_wsdl,$options); Actual result: -------------- [13-Sep-2014 07:47:57 UTC] PHP Warning: SoapServer::SoapServer(): SSL: Success in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 [13-Sep-2014 07:47:57 UTC] PHP Warning: SoapServer::SoapServer(): Failed to enable crypto in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 [13-Sep-2014 07:47:57 UTC] PHP Warning: SoapServer::SoapServer(https://www.plazapinger.com/index.php/api/soap/index/?wsdl=1): failed to open stream: operation failed in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 [13-Sep-2014 07:47:57 UTC] PHP Warning: SoapServer::SoapServer(): I/O warning : failed to load external entity "https://www.plazapinger.com/index.php/api/soap/index/?wsdl=1" in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 [13-Sep-2014 07:47:57 UTC] PHP Notice: SoapServer::SoapServer(): failed to discard buffer. No buffer to discard in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 [13-Sep-2014 07:47:57 UTC] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://www.plazapinger.com/index.php/api/soap/index/?wsdl=1' : failed to load external entity "https://www.plazapinger.com/index.php/api/soap/index/?wsdl=1" in /home/plaza/public_html/lib/Zend/Soap/Server.php on line 826 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68017&edit=1

« previous php.bugs (#199544) next »