feat!: Replace HTTP/2 support with HTTPS - #1532
Conversation
|
I found some cases that do not seem to be working now. Issue 1Status in the main branch: Steps to reproduce:
Expected result: Observed result: Issue 2Status in the main branch: Steps to reproduce:
Expected result: Observed result: Workaround:
|
|
Thank you for finding those issues. I only did a quick manual test and had framework libs and the certs already available. Issue 1 will be fixed via #1535 |
Remove the `--h2` option of `ui5 serve` and the underlying HTTP/2 infrastructure, and add a new `--https` option in its place. HTTP/2 was served via the `spdy` package, which is unmaintained and does not work with Node.js v24 and higher. The new `--https` option uses Node.js' built-in `https` server instead. The existing SSL certificate handling (auto-generation, `--key`/`--cert`) is reused. JIRA: CPOUI5FOUNDATION-1310 JIRA: CPOUI5FOUNDATION-1311 See: #327 Closes: #1131 BREAKING CHANGE: The `--h2` option of `ui5 serve` has been removed. Use `--https` to serve the project over HTTPS. The `@ui5/server` `serve()` option `h2` and the returned `h2` property have been renamed to `https`. If you need HTTP/2 for local development, put a reverse proxy (e.g. nginx) in front of the server to terminate it.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The HTTPS test disabled certificate validation via NODE_TLS_REJECT_UNAUTHORIZED=0. Replace this with proper trust of the server certificate via superagent's .ca() on the test agent, applied once so all requests inherit it. The previous fixture server.crt was a leaf certificate signed by a separate, uncommitted CA, so it could not act as its own trust anchor. Regenerate it as a genuine self-signed certificate for localhost.
|
Issue 2 needs to be discussed on how to proceed. This is a regression caused by #1439, not related to this PR/feature. |
|
What are the options to proceed (or should we discuss it in our sync)? |
|
I would prefer removing the prompt from the standard "ui5 serve" command and instead having a dedicated CLI command to generate a local cert. Usually it is a one-time task and currently you can only generate it in combination with starting a server. So I believe splitting them up will not only resolve the interactive console issue, but also make it more flexible for users. |
Remove the
--h2option ofui5 serveand the underlying HTTP/2 infrastructure, and add a new--httpsoption in its place.HTTP/2 was served via the
spdypackage, which is unmaintained and does not work with Node.js v24 and higher. The new--httpsoption uses Node.js' built-inhttpsserver instead. The existing SSL certificate handling (auto-generation,--key/--cert) is reused.JIRA: CPOUI5FOUNDATION-1310
JIRA: CPOUI5FOUNDATION-1311
See: #327
Closes: #1131
BREAKING CHANGE: The
--h2option ofui5 servehas been removed. Use--httpsto serve the project over HTTPS. The@ui5/serverserve()optionh2and the returnedh2property have been renamed tohttps. If you need HTTP/2 for local development, put a reverse proxy (e.g. nginx) in front of the server to terminate it.