From 9419242465152b4aa9f52d832f9b655e52596cb8 Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Tue, 31 Oct 2023 10:04:02 +0100 Subject: [PATCH 1/2] 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; From 2b6b76b78d0d4baca88cdd86dba93e222adbb86a Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Fri, 17 Nov 2023 14:39:42 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 445ceb9..cae8d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Fixed +* letsencrypt: Add required check when retrieving certificate. (Avoid TypeError.) + ### Removed ### Security