Skip to content

ERR_SSL_VERSION_OR_CIPHER_MISMATCH when both --https and server.https provided #10058

@JakeYallop

Description

@JakeYallop

Describe the bug

When using server.https set to true, subsequently passing the --https CLI flag to vite causes a ERR_SSL_VERSION_OR_CIPHER_MISMATCH when trying to load the page served by the dev server. Reloading the page does not have any effect on the issue.

The reproduction steps are listed below, additionally, the reproduction stackblitz link with the project set up as stated below also errors out in an odd way.

  • npm create vite
  • react
  • typescript
  • Add
  {
      server: { https: true }
  }

to vite.config.ts

In package.json, under scripts, dev, pass --https to vite.

The above reproduces with both https: true, and a custom SSL cert and key file https: { key: ..., cert: ...} . I ran into this issue when I was resurrecting an older project that I hadn't visited for a few months - I had a specific cert and key file, but was also passing --https in my startup script. This suggests that this is a regression, and that this scenario was working at some point with vite 3.x.

Reproduction

https://stackblitz.com/edit/vitejs-vite-8esgks?file=package.json,vite.config.ts&terminal=dev

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 1.94 GB / 15.95 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 7.19.1 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.27)

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions