File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ const main = async (args: Args): Promise<void> => {
3737 port : typeof args . port !== "undefined" ? args . port : process . env . PORT !== "" ? process . env . PORT : 8080 ,
3838 socket : args . socket ,
3939 }
40+
4041 if ( ! options . cert && args . cert ) {
4142 const { cert, certKey } = await generateCertificate ( )
4243 options . cert = cert
4344 options . certKey = certKey
45+ } else if ( args . cert && ! args [ "cert-key" ] ) {
46+ throw new Error ( "--cert-key is missing" )
4447 }
4548
4649 const httpServer = new HttpServer ( options )
@@ -70,7 +73,7 @@ const main = async (args: Args): Promise<void> => {
7073 if ( httpServer . protocol === "https" ) {
7174 logger . info (
7275 typeof args . cert === "string"
73- ? ` - Using provided certificate${ args [ "cert-key" ] ? " and key" : "" } for HTTPS`
76+ ? ` - Using provided certificate and key for HTTPS`
7477 : ` - Using generated certificate and key for HTTPS` ,
7578 )
7679 } else {
You can’t perform that action at this time.
0 commit comments