[FIX] hw_drivers: Certificate checked before start nginx

Currently we verify the SSL certificate of the iot after starting the nginx web server.

So for the Windows iot if a new certificate is downloaded it will only be loaded by nginx
on the next restart of the iot because the process that runs nginx is a child of the one that runs the iot

With this commit we restart the windows iot if a new certificate is uploaded

closes odoo/odoo#112945

X-original-commit: 880afb3006ece93ee6575c977233bfb61081bf3a
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
lejeune quentin
2023-02-17 12:07:48 +01:00
parent fc9eb4691e
commit ab57a7fef4
+4 -1
View File
@@ -257,7 +257,10 @@ def load_certificate():
Path(get_path_nginx()).joinpath('conf/nginx-cert.crt').write_text(result['x509_pem'])
Path(get_path_nginx()).joinpath('conf/nginx-cert.key').write_text(result['private_key_pem'])
time.sleep(3)
start_nginx_server()
if platform.system() == 'Windows':
odoo_restart(0)
elif platform.system() == 'Linux':
start_nginx_server()
def download_iot_handlers(auto=True):
"""