Skip to content

PFX Certs are not working #4495

@JohnCampionJr

Description

@JohnCampionJr

Describe the bug

When specifying a PFX cert and passphrase, there are two problems:

  • The automatic localhost cert/key are still being generated, overriding the PFX
  • Once that is solved, Node throws an error that it wants the passphrase as a buffer for PFX certs.

PR is coming shortly.

Reproduction

https://github.com/JohnCampionJr/vite-pfx-cert

Created a test repo with a self-created localhost.pfx file. Does not work with current vite, before my PR.

After PR, works perfectly.

Running this

vite --port 3333 --https.pfx ..\\mycert.pfx --https.passphrase 1234

With a valid cert shows the problem.

System Info

System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
    Memory: 9.54 GB / 31.90 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 92.0.4515.131
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.62)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @vitejs/plugin-vue: ^1.3.0 => 1.3.0
    vite: ^2.4.4 => 2.5.0-beta.0

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions