feat: add --no-ssl to serve plain HTTP despite the certificates - #25
Open
luca-71 wants to merge 1 commit into
Open
feat: add --no-ssl to serve plain HTTP despite the certificates#25luca-71 wants to merge 1 commit into
luca-71 wants to merge 1 commit into
Conversation
SSL was auto-enabled whenever key.pem and cert.pem existed, with no way to opt out short of moving the files. That matters for an always-on local install: a self-signed certificate makes the browser interrupt with a warning on every visit. Browsers treat localhost as a secure context over plain HTTP, so the microphone and the Web Speech API work either way — the certificate buys nothing locally and costs a click each time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSL is auto-enabled whenever
key.pemandcert.pemexist, and there is no way to opt out short of moving the files:Since the documented setup tells you to generate those certificates in step 6, every install ends up on HTTPS with a self-signed certificate, and the browser interrupts with a warning on each visit.
That is invisible while the Vite dev server is the front door — it serves plain HTTP on 5173 and proxies to the backend, so the warning never surfaces. It becomes the whole experience the moment you serve the built frontend from the server itself, which is what an always-on local install wants.
Why plain HTTP is fine here
Browsers treat
localhostas a secure context regardless of scheme, sogetUserMediaand the Web Speech API work over HTTP exactly as they do over HTTPS. The certificate buys nothing on a loopback interface and costs a click every time.The flag changes nothing for anyone who does not pass it: auto-detection still applies, and
--sslstill forces HTTPS on.Precedence
--no-sslwins over both auto-detection and an explicit--ssl, which is the useful reading of a contradictory pair — the more specific "definitely not" beats the general "yes".Verified
With
cert.pemandkey.pempresent:server.pyserver.py --no-sslserver.py --ssl --no-sslThe startup banner announces the scheme it actually bound, so
ws://vswss://stays honest.Testing
pytest tests/gives 35 passed, 8 failed — identical tomain, so no regressions. The 8 pre-existing failures are unrelated: 7 needplaywright install, andtest_browse_action_keywordsimportsACTION_KEYWORDS, a symbol that no longer exists inserver.py.Independent of #21, #22, #23 and #24; cut from
main, and a one-line behaviour change plus a flag.🤖 Generated with Claude Code