Re: [SOAP] soapclient using https randomly closes connection
| From: | Bernhard Ege | Date: | Fri, 25 Sep 2009 07:39:55 +0000 |
| Subject: | Re: [SOAP] soapclient using https randomly closes connection | ||
| References: | 1 2 | Groups: | php.soap php.soap |
| Request: | Send a blank email to php-soap+get-2988@lists.php.net to get a copy of this message | ||
Sriram Natarajan wrote:
Bernhard Ege wrote:Thank you for the response, but there is plenty of space to save the WSDL file. Also, if I cache the wsdl file, the actual service calls fail to send a request (the tcp connection is created). As the same soap service can be accessed via http instead of https, AND http never fails, the problem seems to be creating a SSL context for some reason. When retrying, it works after about 10-15 seconds but fails immediately when retrying before that. Because https is unrealiable, I have created a http<->https tunnel using stunnel and I have made SoapClient access using http via stunnel (that converts to/from https stream) to the webservice. Doing this is so far 100% reliable (even without caching the wsdl file). To me this clearly indicates that SoapClient has occasional problems with SSL (in php 5.2.9 on Solaris). I'll create en rc-file to ensure stunnel is started when the OS boots and with that I have worked around the bug in SoapClient. /BernhardI am using php 5.2.9 (solaris) and have access to a .NET webservice that I have to access using https. In most cases, accessing it works just fine, but every now and again, SoapClient closes the connection before actually having transfered the request, erroring with "could not connect to host ...". I have captured the actual communication using snoop and examined the result in wireshark and I see that the tcp connection to the webservice is established correct, but before the request is transmitted, SoapClient closes the tcp-connection which is acknowledged by the webservice which also resets the TCP connection. When I disable the caching of the WSDL file for SoapClient, I get these errors (not always, only sometimes): Warning: SoapClient::SoapClient() [soapclient.soapclient]: failed to create an SSL context in /space/hom Warning: SoapClient::SoapClient() [soapclient.soapclient]: Failed to enable crypto in /space/homeThis warning suggests that PHP is unable to create a SSL stream context . By default, if you disable caching, PHP has to download the wsdl to your /tmp directory. Is is possible you are running out of disk space in /tmp. - Sriram