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).
#Vite local https causes Headers.set :method is an invalid header name error
1 messages · Page 1 of 1 (latest)
I get the same thing using the basicSSL plugin for vite. If I change to node 20.11.1 all is good.
I also get this. There's a workaround posted here https://github.com/remix-run/remix/issues/7867#issuecomment-1842799745 where you add an empty proxy object, and that forces a downgrade to http1.
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)