liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
541 stars 37 forks source link

Using this plugin from a GUI without commandline access #72

Open hybridherbst opened 12 months ago

hybridherbst commented 12 months ago

Clear and concise description of the problem

We want to switch from vite-plugin-basic-ssl to vite-plugin-mkcert for the added ability to install the root certificate to other devices. However, we face a blocker: vite-plugin-mkcert asks for a sudo password during the creation of the certificate on Mac, while it displays a dialogue on Windows. Since we're calling npm run dev from a visual interface, users can't securely enter passwords into the shell, and that prevents us from using it on Mac.

Suggested solution

Not entirely sure. Could a visual UI also be shown on Mac OS to ask users for the password / permissions? My guess is that this could also allow using Touch ID instead of the passwort, but I'm not entirely sure.

Alternative

Ask users to run a command line command when they otherwise work completely in a GUI environment.

Additional context

We considered using mkcert directly (instead of the vite plugin) but the added convenience of not having to specify the location of the cert is great to have for non-technical users.

liuweiGL commented 11 months ago
  1. Running a "visual interface" with administrator privileges.
  2. Changing computer settings: https://apple.stackexchange.com/questions/259093/can-touch-id-on-mac-authenticate-sudo-in-terminal
  3. Submit a PR to acquire administrator privileges before exec the mkcert install command.

I can only provide you with some suggestions as I do not have a Mac computer 😭