From: ryan dot hansen at usa dot net
Operating system: Debian
PHP version: 4.3.8
PHP Bug Type: cURL related
Bug description: cURL https request fails when connecting to IP (not domain)
Description:
------------
When attempting to connect to an IP address (not a domain) over SSL using
cURL (7.9.5), there is no response, no errors, etc. I get nothing. When
I test the same script with a domain (a different server), I get a
response as expected. When I test it with the correct IP address over
HTTP (non-secure), I also get a response as expected.
The problem, however, is that the server that I have to connect to for the
app I'm building does not have a domain, only an IP address and it must be
a secure connection.
I admit that I could be missing something, but I can't figure out what it
is and I've tested it pretty thoroughly under multiple scenarios.
Reproduce code:
---------------
$postdata = "POST DATA TO POST TO SERVER";
// use appropriate IP, of course
$ch = curl_init("https://xxx.xxx.xxx.xxx");
curl_setopt($ch, CURL_POST, 1);
curl_setopt($ch, CURL_POSTFIELDS, $postdata);
curl_setopt($ch, CURL_ERROR, 1);
curl_setopt($ch, CURL_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);
// print result for testing
echo $retval;
exit;
Expected result:
----------------
The echo statement should print the web page data from the IP to the
screen, and it does when I test with non-secure IP or domain.
Actual result:
--------------
Nothing. The echo statement doesn't seem to print anything. No cURL
errors, no results, no PHP warnings or errors.
--
Edit bug report at http://bugs.php.net/?id=29958&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29958&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29958&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29958&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29958&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29958&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29958&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29958&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29958&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29958&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29958&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29958&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29958&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29958&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29958&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29958&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29958&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29958&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29958&r=float