Skip to content

Commit

Permalink
Fix ssl stream reneg limit test to print only after first renegotiation
Browse files Browse the repository at this point in the history
It has been reported that in some setup the test does multiple
renegotiations which is allowed.
  • Loading branch information
bukka committed Sep 9, 2018
1 parent 90d8638 commit be50a72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/openssl/tests/stream_server_reneg_limit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ if(substr(PHP_OS, 0, 3) == 'WIN') {
*/

$serverCode = <<<'CODE'
$printed = false;
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug54992.pem',
'reneg_limit' => 0,
'reneg_window' => 30,
'reneg_limit_callback' => function($stream) {
var_dump($stream);
'reneg_limit_callback' => function($stream) use (&$printed) {
if (!$printed) {
$printed = true;
var_dump($stream);
}
}
]]);
Expand Down

0 comments on commit be50a72

Please sign in to comment.