I get SSL connection timeout error when I try sending xml message and expect a response:
$xml = <<<EOL
<?xml version='1.0' encoding='UTF-8'?>
<abc>
<UserId>123</UserId>
</abc>
EOL;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('xmlmessage' => $xml));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
$result = curl_exec($ch);
if ($result === FALSE) {
die(curl_error($ch));
}
echo $result
Can anyone help?
On the code above you are missing:
Other than that, you need to make sure curl has ssl support. Create a file named “test.php” and put the following in it:
then load the page via your browser. On the output, scroll down towards the “middle” of the page where
you can see details about the modules installed/enabled. Look for the curl information. If it has SSL support
you will see something SIMILAR to (notice how it “mentions” ssl):
Otherwise you’ll need to contact the server admin to have him/her install ssl support for it.