#Vite local https causes Headers.set :method is an invalid header name error

1 messages · Page 1 of 1 (latest)

wet cairn
#

Hi, trying to use https for local development (pwa), and setting my vite configuration as server: { { https: { cert: fs.readFileSync(process.env.SSL_CRT_FILE ?? ''), key: fs.readFileSync(process.env.SSL_KEY_FILE ?? ''), }, }} But I receive the error Headers.set: ":method" is an invalid header name. when i remove the server block with https everything works. (the SSL files are correct, I've used them for other apps).

whole valve
toxic forum
#

This worked along with the basicSsl plugin to get the Vite server to start

#

Now i'm getting the following error in browser:

SecurityError: Failed to register a ServiceWorker for scope ('https://localhost:5174/') with script ('https://localhost:5174/entry.worker.js'): An SSL certificate error occurred when fetching the script.

i suspect this is because the certs generated by the plugin still aren't considered totally safe. (not really asking for help, just posting for info/context)