473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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="<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 ???

Apr 18 '07 #1
2 2227
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.
Apr 19 '07 #2
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 ???
Apr 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: D Benfer | last post by:
Hi all, Im a bit thrown by curl. I want to submit some order data on an ecommerce site via a form to a php page, where the data is saved to a database. Then I want to use curl to submit the form...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
7
by: lawrence k | last post by:
I'm reading over this page: http://www.php.net/manual/en/ref.curl.php What I'm missing is why? What problem does curl solve? What does it make easier? When would I use its functions, instead...
1
by: devranger | last post by:
Hello, I am in the process of learning PHP CURL and in doing some test examples I am having some issues with CURL that I do not fully understand. I am doing a test to use CURL to post and return...
0
by: xerc | last post by:
I am trying to create a generic function I can call to download all files from a single remote FTP directory -- using CURL. I want to multi-thread it, but need to get the single thread functionality...
1
by: sik of it | last post by:
I am using windows xp. Hi, I am really new to cURL (started today) and funnily enough haven't even got it to output anything yet! Anway my problem is when using the following code I always get...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
4
by: rottmanj | last post by:
I am working on a revamp of a previous application that I have written in coldfusion. The application deals with RETS data. The issue that I am having is with using the curl option HTTP_AUTH and...
11
by: Flexor | last post by:
I have a php script that runs from command line and makes an https request to paypal, using curl. It works fine if I run it from a web page. It fails if I run it from CLI. The error I get from...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.