|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-17 10:56 UTC] jarkkohyvarinen at hotmail dot com
[2015-07-27 12:46 UTC] lukas at owncloud dot com
[2019-03-26 17:36 UTC] mike@php.net
-Status: Open
+Status: Not a bug
[2019-03-26 17:36 UTC] mike@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
Description: ------------ If I do two back-to-back queries to our server using two different server aliases (pointing to same server) first query executes successfully but second query always causes HTTP error 400. Apache ssl_error_log has an "Hostname www.server.com provided via SNI and hostname alias.server.com provided via HTTP are different" describing the 400 error. Our server has Apache 2.2.15, OpenSSL 1.0.1e and cURL 7.19.7. --- Workaround is to use stream_context_create with SNI_enabled and SNI_server_name options. Test script: --------------- function doCurl($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $code; } echo "HTTP Status: ".doCurl("https://www.server.com")."\n"; echo "HTTP Status: ".doCurl("https://alias.server.com")."\n"; Expected result: ---------------- HTTP Status: 200 HTTP Status: 200 Actual result: -------------- HTTP Status: 200 HTTP Status: 400