Thurston Roeth - 2012-05-30

cURL ERROR: 28: SSL connection timeout, from the nusoap debug

However, curl standalone run from command line (this is windows), has no timeout to the same url and connects within milliseconds.
URL is in the format of:

https://site.com:443/Dest

Code is below (stripped of whatever we can't show), its really simple, we stick a wsse security header into the envelope, and send a really simple array.

Somehow this takes about 9 seconds for nusoap to format, then from the debug curl is invoked and in less than a millisecond, the error: HTTP Error: cURL ERROR: 28: SSL connection timeout   shows.


<?php
/*
* $Id: wsdlclient9.php,v 1.2 2007/11/06 14:50:06 snichol Exp $
*
* WSDL client sample.
*/

require_once('../lib/nusoap.php');

$username='user';
$password=password';
$header = '<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd"><wsse:UsernameToken>……..></wsse:Security>';
$data = array(
'Provider_Name'=>'Provider',
'hours'=>'1',);

$client = new nusoap_client('file://c:/local.wsdl',true);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->useHTTPPersistentConnection();
$client->use_curl=true;
$client->setCurlOption(CURLOPT_TIMEOUT,5);
$result = $client->call('process', $params=array($data),'','',$header);

// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>