fix(letsencrypt): check for false as to avoid TypeError #84

Merged
mtrossevin merged 3 commits from fix-letsencrypt into unstable 2023-11-30 16:36:18 +01:00
2 changed files with 5 additions and 0 deletions

View file

@ -20,6 +20,8 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Fixed ### Fixed
* letsencrypt: Add required check when retrieving certificate. (Avoid TypeError.)
### Removed ### Removed
### Security ### Security

View file

@ -157,6 +157,9 @@ class LetsEncrypt
{ {
$stream = stream_context_create(array("ssl" => array("capture_peer_cert" => true))); $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); $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); $cont = stream_context_get_params($read);
return $cont; return $cont;