Skip to content
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

Client websocket connect failed when using https option and reverse proxy #1925

Closed
ygj6 opened this issue Feb 7, 2021 · 2 comments
Closed

Comments

@ygj6
Copy link
Member

ygj6 commented Feb 7, 2021

Describe the bug

Vite client connects to websocket server failed when using https option and reverse proxy to map ports.

Reproduction

npm init @vitejs/app viteapp --template vue
cd viteapp
npm install
npx vite --https

Set haproxy config to map ports

frontend port3001
    bind *:3001 ssl crt /etc/haproxy/cert.pem
    default_backend default

backend default
    server port3000 xx.xx.xx.xx:3000 ssl verify none  # xx.xx.xx.xx is server IP

Open url https://xx.xx.xx.xx:3001 in browser, it will go into an endelss loop trying to reconnect.

System Info

  • vite version: 2.0.0-beta.65
  • Operating System: Ubuntu 18.04.2 LTS
  • Node version: v14.15.4
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.10

Logs (Optional if provided reproduction)

the console of browser print:

WebSocket connection to 'wss://xx.xx.xx.xx:3000' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID
@ygj6
Copy link
Member Author

ygj6 commented Feb 7, 2021

It is similar to #1653

@yyx990803
Copy link
Member

I assume the hmr port config option already addresses the issue according to your comment here: #1926 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants