|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-04-02 14:47 UTC] f at zuckschwerdt dot de
[2022-10-05 20:35 UTC] bukka@php.net
-Package: Streams related
+Package: OpenSSL related
[2025-06-05 12:16 UTC] bukka@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: bukka
[2025-06-05 12:16 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
Description: ------------ calling `file_get_contents` through a configured proxy to an ssl site will let the certificate check "lag" one behind. with the first call of the `file_get_contents` the certificate for the requested site will be "locked in" for the next call. which will therefor fail. so only the first call of `file_get_contents` will be successful, the rest will fail. Test script: --------------- <?php $stream_default_opts = [ 'http' => [ 'proxy'=>"tcp://5.9.78.28:3128", 'request_fulluri' => true, ] ]; stream_context_set_default($stream_default_opts); file_get_contents("https://www.symfony.com", false); file_get_contents("https://getcomposer.org", false); file_get_contents("https://github.com", false); Actual result: -------------- Warning: file_get_contents(): Peer certificate CN=`getcomposer.org' did not match expected CN=`www.symfony.com' in foo.php on line 11 Warning: file_get_contents(https://getcomposer.org): failed to open stream: Cannot connect to HTTPS server through proxy in foo.php on line 11 Warning: file_get_contents(): Peer certificate CN=`github.com' did not match expected CN=`www.symfony.com' in foo.php on line 12 Warning: file_get_contents(https://github.com): failed to open stream: Cannot connect to HTTPS server through proxy in foo.php on line 12