aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Tomasina <tomasinap@gmail.com>2016-10-05 23:45:08 +0200
committerPierre Tomasina <tomasinap@gmail.com>2016-10-05 23:45:08 +0200
commit4d14eab3976a3dea620e83bcb7a24342d3532f31 (patch)
treef46fda1906e0d3e2a5e6c0e65f13d1fa7f1e6a40
parent3eca29893c40e8dedad0e30ee5f1cc55e764f579 (diff)
downloadWebsocket-4d14eab3976a3dea620e83bcb7a24342d3532f31.zip
Websocket-4d14eab3976a3dea620e83bcb7a24342d3532f31.tar.gz
Websocket-4d14eab3976a3dea620e83bcb7a24342d3532f31.tar.bz2
set encryption in handshake if TLS enable
-rw-r--r--Server.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/Server.php b/Server.php
index d7c3fdb..6afe34f 100644
--- a/Server.php
+++ b/Server.php
@@ -89,6 +89,11 @@ class Server extends Connection
protected function doHandshake()
{
$connection = $this->getConnection();
+
+ if (true === $connection->getSocket()->isSecured()) {
+ $connection->enableEncryption(true, $connection::ENCRYPTION_TLS);
+ }
+
$buffer = $connection->read(2048);
$request = $this->getRequest();
$request->parse($buffer);