-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port 443 doesn't work (i.e. https://local.example.com/ does not work) #11342
Comments
Would you write the actual command? |
That command looks for cert.pem, but it actually reproduces the error as well once I specify the certs: npx http-server -a local.example.com -p 443 --tls -C local.example.com.pem -K local.example.com-key.pem I get But this is the command that does work: npx http-server . -S -C local.example.com.pem -K local.example.com-key.pem -p 443 The root cause seems to have something to do with the difference between those two commands. |
It seems to be the |
When If you change, Showing the domain host in output when |
Thanks! This works: import fs from 'fs'
import { defineConfig } from 'vite'
export default defineConfig({
server: {
host: '0.0.0.0', // or true
port: 443,
https: {
key: fs.readFileSync('./local.example.com-key.pem'),
cert: fs.readFileSync('./local.example.com.pem'),
},
},
}) I would still like to understand why vite defaults to localhost, as this issue's solution is not very intuitive. Is it a security thing (link for anyone reading to understand the difference)? I think it's worth considering why Node.js |
Vite does behave the same with Node.js and About When you pass |
Describe the bug
With
port: 443
in the Vite config, Thevite
command errors withEACCES: permission denied 127.0.0.1:443
. This means we're forced to use an explicit port such as5173
. Oddly when usinghttp-server
there is no such issue. This meanshttps://local.example.com/
does not work.Reproduction
N/A only reproduces locally
Steps to reproduce
Run
yarn create vite
Run
brew install mkcert mkcert -install mkcert local.example.com # run from the project folder
Change the config to:
Run
yarn start
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: