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

Enable both manual and automatic HTTPS/SSL mode #627

Open
nermin99 opened this issue Aug 13, 2020 · 7 comments
Open

Enable both manual and automatic HTTPS/SSL mode #627

nermin99 opened this issue Aug 13, 2020 · 7 comments

Comments

@nermin99
Copy link

Why was support(#274) for automatic HTTPS removed? As per #520 and #511 it is understandable that users might want to use manual certs and keys, but there is still, no even more, use cases for automatic SSL/HTTPS. One of the biggest reasons why serve is so popular is because it's a one-line command to literally "serve" your application. If a user wants or for some reason needs HTTPS they don't wanna have to go through a whole process of installing another tool just to get it.

Personally I stumbled upon serve when building my create-react-app and wanted to "serve" it. But because I use service workers and push notifications I need to serve it over HTTPS so I can test on other devices on the network. Sure I can get HTTPS for my self as per #520, but my co-workers can't, since they might not have their own manual certs and keys... you see the problem?

There is no reason why both manual and automatic HTTPS can't be supported.

@jwarby
Copy link

jwarby commented Oct 14, 2020

It looks like support was dropped during a rewrite in 2018, whether intentionally or not I don't know 🤷

For now I'm running serve at version 6 instead (npx serve@6 --ssl ...) and it's working well for my particular use case (serving builds on localhost over HTTPS and running end-to-end tests against them).

@TimDaub
Copy link

TimDaub commented Mar 3, 2021

For now I'm running serve at version 6 instead (npx serve@6 --ssl ...) and it's working well for my particular use case

lovely :) Thanks for pointing out that version.

@TimDaub
Copy link

TimDaub commented Mar 4, 2021

I fix and published vercel/[email protected] as npm i ssl-serve.
Repo: https://github.com/TimDaub/ssl-serve

@warren-bank
Copy link

warren-bank commented Feb 16, 2022

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve

notes:

  • --ssl is a convience option that is equivalent to:
  • this is a certificate that I generated with OpenSSL
    • scripts are included to regenerate a new certificate
    • ..if you choose to do so, just make sure the filenames are consistent,
      as --ssl uses hard-coded (relative) paths

@gavinr-maps
Copy link

gavinr-maps commented Oct 16, 2024

@AndyBitz if this functionality (automatic HTTPS/SSL using a self-signed cert when running npx serve --ssl) is added via PR, would the maintainers consider it for merging?

(related/duplicate: #614)

@AndyBitz
Copy link
Contributor

@gavinr-maps Yes! That sounds like a good idea. Functionality wise I can imagine something like we have for Next.js next dev --experimental-https.

@rlidwka
Copy link

rlidwka commented Nov 8, 2024

Is there any option in HTTP 2 or HTTP 3 for opportunistic encryption?

I want serve to be encrypted by default (e.g. if I need to use it to share files to my phone over wifi). But I don't want the browser to scream at me for doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants