php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63488 CURLOPT_RESOLVE not defined
Submitted: 2012-11-11 18:01 UTC Modified: 2012-11-15 05:34 UTC
From: kf at sumptuouscapital dot com Assigned: pierrick (profile)
Status: Wont fix Package: HTTP related
PHP Version: 5.4.8 OS: GNU/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kf at sumptuouscapital dot com
New email:
PHP Version: OS:

 

 [2012-11-11 18:01 UTC] kf at sumptuouscapital dot com
Description:
------------
Since curl 7.21.3 curl_easy_setopt has an option CURLOPT_RESOLVE [0]. Using this option from within PHP results in the following NOTICE and WARNING. Usage of this functionality is necessary for proper Sever Name Indication for verifying CA Certs in certain scenarios. The actual functionality presented by this option seems to work despite the notice and warning. 

The notice is: 

PHP Notice:  Use of undefined constant CURLOPT_RESOLVE - assumed 'CURLOPT_RESOLVE' in /var/www/localhost/htdocs/status-srv/sks_get_peer_data.php on line 351

This Notice can be removed by explicitly setting a string rather than using it as a constant, however, the following Warning is still presented in both scenarios: 

Warning: curl_setopt() expects parameter 2 to be long, string given in /var/www/localhost/htdocs/status-srv/sks_get_peer_data.php on line 351

[0] http://curl.haxx.se/libcurl/c/curl_easy_setopt.html

Test script:
---------------
<?php
// Minimum working example to produce the reported behavior
$ch = curl_init("https://www.google.com:80/");
curl_setopt($ch, CURLOPT_RESOLVE, "google.com:80:173.194.32.5");
curl_exec($ch);
?>

Expected result:
----------------
No warning

Actual result:
--------------
works, but with notice and warning output. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-11 18:27 UTC] kf at sumptuouscapital dot com
Please disregard the part about the functionality working as expected, it does not use the provided information, just worked out in earlier testing due to circumstance. Due to this I'm flagging it as a bug rather than a RFE
 [2012-11-11 18:27 UTC] kf at sumptuouscapital dot com
-Type: Feature/Change Request +Type: Bug
 [2012-11-11 18:43 UTC] felipe@php.net
Such feature has been implemented in master branch only.
 [2012-11-11 18:43 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pierrick
 [2012-11-15 05:34 UTC] pierrick@php.net
-Status: Assigned +Status: Wont fix
 [2012-11-15 05:34 UTC] pierrick@php.net
As mentioned by felipe, it was implemented in the master branch. It was also 
decided on internal to not merge all the new ext/curl features in 5.3/5.4 but 
keep 
them only in php next (5.5). 

Also curl_setopt with CURLOPT_RESOLVE will not take a string as 3rd parameter 
but 
an array of string (the original libcurl option take a curl_slist)

curl_setopt($ch, CURLOPT_RESOLVE, array("google.com:80:173.194.32.5"));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 04 11:01:29 2024 UTC