SSL Connection with cURL
| From: | Roman Eich | Date: | Thu, 20 Dec 2001 20:14:35 +0000 |
| Subject: | SSL Connection with cURL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78354@lists.php.net to get a copy of this message | ||
Hi NG,
i want to establish an SSL connection with cURL. I used two different
scripts,
1)
$URL="ssl.server.com/path/file.ext";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://$URL");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS , "$data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$x = curl_errno($ch);
print("$x<br>$result");
curl_close ($ch);
and get exitcode 1
2)
function cURL ($URL, $options="")
{
$command="/usr/local/bin/curl";
$options.=" --stderr";
$execstring=escapeshellcmd($command." ".$URL." ".$options);
exec($execstring, $stdout, $errorcode);
$output = implode ("\n", $stdout);
if ($errorcode<>0) $output="";
return $output;
}
$URL="https://ssl.server.com/path/file.ext";
$options=" -d $data";
$data = cURL ($URL, $options);
and get exitcode 2
Why i get two different exitcodes and why i get in the second version
exitcode 2?
Can anyone help me to solve this problem?
--
Roman