http: Chrome only: Emits additional `error` events for HTTPS only (Unable to complete SSL/TLS handshake)

When i run the 02-hello-world-https.php example, it does work (seeing “hello world” in a browser).

But I am also seeing this error:

php examples/02-hello-world-https.php 
Listening on https://0.0.0.0:8443
exception 'UnexpectedValueException' with message 'Unable to complete SSL/TLS handshake: ' in /Users/*********/Projects/http/vendor/react/socket/src/StreamEncryption.php:112
Stack trace:
#0 /Users/*********/Projects/http/vendor/react/socket/src/StreamEncryption.php(78): React\Socket\StreamEncryption->toggleCrypto(Resource id #28, Object(React\Promise\Deferred), true)
#1 [internal function]: React\Socket\StreamEncryption->React\Socket\{closure}(Resource id #28, Object(React\EventLoop\StreamSelectLoop))
#2 /Users/*********/Projects/http/vendor/react/event-loop/src/StreamSelectLoop.php(232): call_user_func(Object(Closure), Resource id #28, Object(React\EventLoop\StreamSelectLoop))
#3 /Users/*********/Projects/http/vendor/react/event-loop/src/StreamSelectLoop.php(201): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#4 /Users/*********/Projects/http/examples/02-hello-world-https.php(29): React\EventLoop\StreamSelectLoop->run()
#5 {main}exception 'UnexpectedValueException' with message 'Unable to complete SSL/TLS handshake: ' in /Users/*********/Projects/http/vendor/react/socket/src/StreamEncryption.php:112
Stack trace:
#0 /Users/*********/Projects/http/vendor/react/socket/src/StreamEncryption.php(78): React\Socket\StreamEncryption->toggleCrypto(Resource id #55, Object(React\Promise\Deferred), true)
#1 [internal function]: React\Socket\StreamEncryption->React\Socket\{closure}(Resource id #55, Object(React\EventLoop\StreamSelectLoop))
#2 /Users/*********/Projects/http/vendor/react/event-loop/src/StreamSelectLoop.php(232): call_user_func(Object(Closure), Resource id #55, Object(React\EventLoop\StreamSelectLoop))
#3 /Users/*********/Projects/http/vendor/react/event-loop/src/StreamSelectLoop.php(201): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#4 /Users/*********/Projects/http/examples/02-hello-world-https.php(29): React\EventLoop\StreamSelectLoop->run()
#5 {main}

Also I think the response time might be low side.

I did have to include a cafile in the example code

$loop = Factory::create();
$socket = new Server(isset($argv[1]) ? $argv[1] : '0.0.0.0:8443', $loop);
$socket = new SecureServer($socket, $loop, array(
    'local_cert' => $argv[2]. '/bin/combined.pem',
    'cafile' => $argv[2]. '/bin/intermediate.pem',
));

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

@bassim All intermediates should be appended to combined.pem then, "cafile" is used for peer verification.