Skip to content

Commit b8e6369

Browse files
committed
Fix empty --cert not generating self-signed certificate
Fixes #1101.
1 parent d81d5f4 commit b8e6369

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/node/cli.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,8 @@ const startVscode = async (): Promise<void | void[]> => {
101101
options.password = await generatePassword();
102102
}
103103

104-
if (!options.certKey && typeof options.certKey !== "undefined") {
105-
throw new Error(`--cert-key cannot be blank`);
106-
} else if (options.certKey && !options.cert) {
107-
throw new Error(`--cert-key was provided but --cert was not`);
108-
} if (!options.cert && typeof options.cert !== "undefined") {
104+
// This is necessary since VS Code filters out empty strings.
105+
if (typeof options.cert === "undefined" && process.argv.indexOf("--cert") !== -1) {
109106
const { cert, certKey } = await generateCertificate();
110107
options.cert = cert;
111108
options.certKey = certKey;

0 commit comments

Comments
 (0)