You are here: Re: SSL curl connection not working « PHP Programming Language « IT news, forums, messages
Re: SSL curl connection not working

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация