From d54c0d8aefb9906d9fa1510277def4173ce097c6 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 5 Jan 2018 14:49:53 +0000 Subject: [PATCH] tcpserver : do not check the client certificate in SSL mode, as there is no certificate provided by it ! git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4021 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- tcpserver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcpserver.php b/tcpserver.php index b332d48..af55204 100644 --- a/tcpserver.php +++ b/tcpserver.php @@ -225,7 +225,13 @@ class tcpserver if ($this->socket === null) throw new \Exception ("Can not send to server $this->ipOrName : ". "The server is not connected", 500); + // Setting the options allow the IP to be decided by the connect and valid + // the certificate of the server by the name + $options = array ("ssl" => array ( + "verify_peer_name" => false, + )); stream_set_blocking ($this->socket, true); + stream_context_set_option ($this->socket, $options); return stream_socket_enable_crypto ($this->socket, !!$val, $cryptoMethod); }