From 8e2abacff6e7a58d9489258c064908d9d52da9e0 Mon Sep 17 00:00:00 2001 From: Connor Roberts <32241825+murshex@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:08:08 +0700 Subject: [PATCH 1/2] fix(upgrade): Support PFX certificate for dev server --- src/commands/dev.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index a488f3233..83087c809 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -280,6 +280,16 @@ function _resolveListenOptions( || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https?.key) || '' + const _httpsPfx + = args['https.pfx'] + || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https?.pfx) + || '' + + const _httpsPassphrase + = args['https.passphrase'] + || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https?.passphrase) + || '' + const httpsEnabled = args.https == true || (args.https === undefined && !!nuxtOptions.devServer.https) @@ -290,6 +300,8 @@ function _resolveListenOptions( 'https': httpsEnabled, 'https.cert': _httpsCert, 'https.key': _httpsKey, + 'https.pfx': _httpsPfx, + 'https.passphrase': _httpsPassphrase }) const httpsOptions = httpsEnabled && { From 4e634e18301ba15df581db324a2ac9b0f45f8cdf Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 5 Jan 2025 22:16:05 +0000 Subject: [PATCH 2/2] chore: fix types --- src/commands/dev.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index b488f2523..2f57e84ff 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -282,12 +282,12 @@ function _resolveListenOptions( const _httpsPfx = args['https.pfx'] - || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https?.pfx) + || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https && 'pfx' in nuxtOptions.devServer.https && nuxtOptions.devServer.https.pfx) || '' const _httpsPassphrase = args['https.passphrase'] - || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https?.passphrase) + || (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https && 'passphrase' in nuxtOptions.devServer.https && nuxtOptions.devServer.https.passphrase) || '' const httpsEnabled @@ -301,7 +301,7 @@ function _resolveListenOptions( 'https.cert': _httpsCert, 'https.key': _httpsKey, 'https.pfx': _httpsPfx, - 'https.passphrase': _httpsPassphrase + 'https.passphrase': _httpsPassphrase, }) const httpsOptions = httpsEnabled && {