From 9419242465152b4aa9f52d832f9b655e52596cb8 Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Tue, 31 Oct 2023 10:04:02 +0100 Subject: [PATCH] fix(letsencrypt): check for false as to avoid TypeError --- lib/letsencrypt.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/letsencrypt.php b/lib/letsencrypt.php index 8c0d2d4..3cf9dbf 100644 --- a/lib/letsencrypt.php +++ b/lib/letsencrypt.php @@ -157,6 +157,9 @@ class LetsEncrypt { $stream = stream_context_create(array("ssl" => array("capture_peer_cert" => true))); $read = stream_socket_client("ssl://" . $domain . ":443", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $stream); + if ($read === false) { + return false; + } $cont = stream_context_get_params($read); return $cont;