feat(cli)!: Add "certificate generate" command - #1560
Conversation
Add "ui5 certificate generate" to create and install the self-signed server certificate before running the dev server. The command honors UI5_DATA_DIR and the configured UI5 data dir, skips existing certificates unless --force is used, and prints the written paths. Split @ui5/server/internal/sslUtil into read-only certificate loading and explicit certificate generation. The root-password prompt now belongs to the CLI command. BREAKING CHANGE: "ui5 serve --https" no longer generates or installs a self-signed certificate when none exists. Run "ui5 certificate generate" first, or pass --key and --cert. JIRA: CPOUI5FOUNDATION-1347
fab2d32 to
3d6b1ce
Compare
|
|
RandomByte
left a comment
There was a problem hiding this comment.
Just some wording feedback/proposals. See my earlier comment regarding Firefox for an actual issue.
7d58b3d to
40c3e1e
Compare
Fixed now. This issue was not visible before, because the server was running after creating the certificate. I've also adjusted the certificate name to "UI5 CLI". |
Co-authored-by: Merlin Beutlberger <merlin.lab@me.com>
This reverts commit a8dccc2256487f20e0a57308f7dd2ab2c382d700.
devcert-sanscache leaves event-loop handles open after generating and installing the certificate: it resumes stdin to wait for the user to confirm the browser import without pausing it again, and its Firefox flow starts an HTTP server that is never closed. On Windows that Firefox flow runs unconditionally, so the process would hang on every run; on macOS/Linux it hangs whenever certutil is unavailable or Firefox is open. Exit the process explicitly with code 0 once generation has completed and the result has been reported, tearing down any leaked handles regardless of platform.
|
LGTM |
|
I have also tested on Windows and noticed a different issue, which should be resolved now. For me it worked as expected to generate a certificate and use it with |
|
I did not get any confirmation or dialog for Firefox on Windows, but the certificate worked and was trusted. |
Add "ui5 certificate generate" to create and install the self-signed server certificate before running the dev server. The command honors UI5_DATA_DIR and the configured UI5 data dir, skips existing certificates unless --force is used, and prints the written paths.
Change the common name of the certificate from "UI5Tooling" to "UI5CLI".
Split @ui5/server/internal/sslUtil into read-only certificate loading and explicit certificate generation. The root-password prompt now belongs to the CLI command.
BREAKING CHANGE: "ui5 serve --https" no longer generates or installs a self-signed certificate when none exists. Run "ui5 certificate generate" first, or pass --key and --cert.
JIRA: CPOUI5FOUNDATION-1347
See: #1532 (comment)