Fix Windows/MSYS2 compatibility: convert Path to str for ssl_context

Flask/Werkzeug's ssl_context parameter expects string paths, not pathlib.Path
objects. On Windows/MSYS2, passing Path objects causes 'Resource temporarily
unavailable' error. Converting to strings maintains Linux compatibility while
fixing Windows support.

Fixes the error reported by user where context showed PosixPath objects
instead of strings, causing Flask to fail on Windows/MSYS2.

Co-Authored-By: Thiago Alves <thiagoralves@gmail.com>
This commit is contained in:
Devin AI
2025-10-08 19:52:35 +00:00
parent 1b82973556
commit 7b16afb69d

View File

@@ -2672,7 +2672,7 @@ def run_https():
print("Credentials already generated!")
try:
context = (CERT_FILE, KEY_FILE)
context = (str(CERT_FILE), str(KEY_FILE))
app_restapi.run(debug=False, host='0.0.0.0', threaded=True, port=8443, ssl_context=context)
except KeyboardInterrupt as e:
print(f"Exiting OpenPLC Webserver...{e}")