Skip to content

Commit

Permalink
feat(dev): support PFX certificate for dev server (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
murshex authored Jan 5, 2025
1 parent 338be35 commit 44e35de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ function _resolveListenOptions(
|| (typeof nuxtOptions.devServer.https !== 'boolean' && nuxtOptions.devServer.https && 'key' in nuxtOptions.devServer.https && nuxtOptions.devServer.https.key)
|| ''

const _httpsPfx
= args['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' in nuxtOptions.devServer.https && nuxtOptions.devServer.https.passphrase)
|| ''

const httpsEnabled
= args.https == true
|| (args.https === undefined && !!nuxtOptions.devServer.https)
Expand All @@ -290,6 +300,8 @@ function _resolveListenOptions(
'https': httpsEnabled,
'https.cert': _httpsCert,
'https.key': _httpsKey,
'https.pfx': _httpsPfx,
'https.passphrase': _httpsPassphrase,
})

const httpsOptions = httpsEnabled && {
Expand Down

0 comments on commit 44e35de

Please sign in to comment.