Bug #65684 [Fbk->Opn]: No error message on wrong SSL certificate with curl_multi

From: Date: Fri, 08 Nov 2013 08:34:53 +0000
Subject: Bug #65684 [Fbk->Opn]: No error message on wrong SSL certificate with curl_multi
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182654@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65684&edit=1 ID: 65684 User updated by: butesa at freenet dot de Reported by: butesa at freenet dot de Summary: No error message on wrong SSL certificate with curl_multi -Status: Feedback +Status: Open Type: Bug Package: cURL related Operating System: Ubuntu 12.04 x64 PHP Version: 5.5.3 Block user comment: N Private report: N New Comment: I'm using curl 7.22.0 Previous Comments: ------------------------------------------------------------------------ [2013-11-08 00:14:24] pierrick@php.net Worked for me with 5.5.3 and cURL 7.33.1-dev Can you tell me which version of libcurl you're having problem with ? Thanks ------------------------------------------------------------------------ [2013-09-17 10:55:36] roborg at hotmail dot com Same thing is happening to me on PHP 5.4.9 but just using curl_exec, not curl_multi. <?php $c = curl_init(); $opts = array ( CURLOPT_URL => 'https://xxxxx' CURLOPT_RETURNTRANSFER => true, ); curl_setopt_array($c, $opts); var_dump(curl_exec($c)); var_dump(curl_errno($c)); var_dump(curl_error($c)); curl_close($c); Expected result: ---------------- bool(false) int(51) string(49) "SSL peer certificate or SSH remote key was not OK" Actual result: ---------------- bool(false) int(51) string(0) "" ------------------------------------------------------------------------ [2013-09-16 18:48:16] butesa at freenet dot de Description: ------------ If you add a curl handle to a curl_multi handle and execute it, you can afterwards use curl_error() on the curl handle. But this doesn't work when the SSL certificate doesn't match the servers name. Test script: --------------- <?php $c = curl_init('https://j-matschke.de'); curl_exec($c); var_dump(curl_errno($c)); var_dump(curl_error($c)); echo "\n"; $m = curl_multi_init(); curl_multi_add_handle($m,$c); $running = 1; while ($running == 1) { while (curl_multi_exec($m, $running) == CURLM_CALL_MULTI_PERFORM); while ($done = curl_multi_info_read($m)) { var_dump($done['result']); var_dump(curl_error($done['handle'])); } sleep(1); } Expected result: ---------------- int(51) string(49) "SSL peer certificate or SSH remote key was not OK" int(51) string(49) "SSL peer certificate or SSH remote key was not OK" Actual result: -------------- int(51) string(49) "SSL peer certificate or SSH remote key was not OK" int(51) string(0) "" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65684&edit=1

« previous php.bugs (#182654) next »