|
Posted by Schraalhans Keukenmeester on 04/19/07 04:05
Olagato wrote:
> Hi,
> I'm trying this SSL curl connection without success:
>
> <?php
> header('Content-Type: text/xml');
>
> $url=urlencode("https://www.one-server.com/one-cgi.cgi");
> $request="<request><plaintext>1111222233334444</plaintext></request>";
>
> $ch = curl_init();
> $res= curl_setopt ($ch, CURLOPT_URL,$url);
>
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , true);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , true);
> curl_setopt($ch, CURLOPT_PORT, 443);
> curl_setopt($ch, CURLOPT_HEADER, true);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> $response = curl_exec ($ch);
>
> curl_close ($ch);
>
> print_r($response);
> ?>
> The error I get is :
>
> "Error de lectura XML: no se encuentra elemento
> Ubicación: http://my_server.com/index.php
> Número de línea 1, columna 1:"
>
> Any ideas ???
>
Could it be you are setting an XML header and the site returned
something that doesn't match the header? If I manually try your request
all I get is a 404 error btw.
Sh.
[Back to original message]
|