SSL curl connection not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Olagato

    #1

    SSL curl connection not working

    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="<requ est><plaintext> 111122223333444 4</plaintext></request>";

    $ch = curl_init();
    $res= curl_setopt ($ch, CURLOPT_URL,$ur l);

    curl_setopt($ch , CURLOPT_SSL_VER IFYPEER , true);
    curl_setopt($ch , CURLOPT_SSL_VER IFYHOST , true);
    curl_setopt($ch , CURLOPT_PORT, 443);
    curl_setopt($ch , CURLOPT_HEADER, true);
    curl_setopt($ch , CURLOPT_POST, 1);
    curl_setopt($ch , CURLOPT_POSTFIE LDS, $request);
    curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);

    $response = curl_exec ($ch);

    curl_close ($ch);

    print_r($respon se);
    ?>
    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 ???

  • Schraalhans Keukenmeester

    #2
    Re: SSL curl connection not working

    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="<requ est><plaintext> 111122223333444 4</plaintext></request>";
    >
    $ch = curl_init();
    $res= curl_setopt ($ch, CURLOPT_URL,$ur l);
    >
    curl_setopt($ch , CURLOPT_SSL_VER IFYPEER , true);
    curl_setopt($ch , CURLOPT_SSL_VER IFYHOST , true);
    curl_setopt($ch , CURLOPT_PORT, 443);
    curl_setopt($ch , CURLOPT_HEADER, true);
    curl_setopt($ch , CURLOPT_POST, 1);
    curl_setopt($ch , CURLOPT_POSTFIE LDS, $request);
    curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
    >
    $response = curl_exec ($ch);
    >
    curl_close ($ch);
    >
    print_r($respon se);
    ?>
    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.

    Comment

    • Olagato

      #3
      Re: SSL curl connection not working

      Our PHP version is 4.3.10 with CURL support enabled.
      CURL Information: libcurl/7.10.5 ipv6 zlib/1.1.4

      Do we need an higher version of CURL in order to support SSL ???


      Comment

      Working...