diff --git a/README.md b/README.md index a0e3c2b3..12741e27 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ SKALE Node CLI, part of the SKALE suite of validator tools, is the command line * Prerequisites -Ensure that the following package is installed: **docker**, **docker-compose** (1.27.4+) +Ensure that the following package is installed: **docker**, **docker-compose** * Download the executable diff --git a/node_cli/cli/__init__.py b/node_cli/cli/__init__.py index e1e6add7..1fe20f2e 100644 --- a/node_cli/cli/__init__.py +++ b/node_cli/cli/__init__.py @@ -1,4 +1,4 @@ -__version__ = '2.6.2' +__version__ = '2.6.3' if __name__ == '__main__': print(__version__) diff --git a/node_cli/core/ssl/check.py b/node_cli/core/ssl/check.py index d512c777..a5c7a0a5 100644 --- a/node_cli/core/ssl/check.py +++ b/node_cli/core/ssl/check.py @@ -20,6 +20,7 @@ import time import socket import logging +import subprocess from contextlib import contextmanager from node_cli.core.ssl.utils import detached_subprocess @@ -201,8 +202,15 @@ def check_ssl_connection(host, port, silent=False): ] expose_output = not silent with detached_subprocess(ssl_check_cmd, expose_output=expose_output) as dp: - time.sleep(1) - code = dp.poll() - if code is not None: - logger.error('Healthcheck connection failed') - raise SSLHealthcheckError('OpenSSL connection verification failed') + timeout = 20 + try: + dp.wait(timeout=timeout) + except subprocess.TimeoutExpired: + logger.error('Healthcheck timed-out after %s s', timeout) + raise SSLHealthcheckError('OpenSSL connection verification timed-out') + + if dp.returncode == 0: # success + return + + logger.error('Healthcheck connection failed (code %s)', dp.returncode) + raise SSLHealthcheckError('OpenSSL connection verification failed') diff --git a/node_cli/core/ssl/utils.py b/node_cli/core/ssl/utils.py index a2e71e1f..c11ebda8 100644 --- a/node_cli/core/ssl/utils.py +++ b/node_cli/core/ssl/utils.py @@ -50,7 +50,7 @@ def detached_subprocess(cmd, expose_output=False): logger.debug(f'Starting detached subprocess: {cmd}') p = subprocess.Popen( cmd, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL, encoding='utf-8' ) try: