-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Feature: disable HTTPS cert verification for debugging #254
base: main
Are you sure you want to change the base?
Conversation
This is technically ready to be merged, but I would like to add a command line toggle with this, to advertise this feature, and to emphasasize that it is dangerous. Planned functionality:
|
I'd also like to have a banner message displayed if HTTPS verification is disabled, so 1. we don't accidentally enable it 2. users are warned that the traffic could be logged. I know it can just be patched out but nonetheless seems prudent. (Also ignore failing checks) |
I'm putting this in "help wanted". This PR is accepting PRs. |
Throws error when the flag is enabled and the eponymous feature is disabled. Currently not linked to any underlying functionality.
Progress update: I have added the command line flag, but it has no functionality. This pr should probably be rebased into at least two commits, since edb16f2 should be a seperate commit. I'm stuck on passing the flag from the main thread to the instantiation of the hyper_rustls client in client.rs. I can probably create a global 'static optional bool variable, and save the outcome there in the main thread; client.rs will then unwrap that variable. But that feels hacky — any better suggestions? I think refactoring into using a Config struct and a clap::Parser pattern is what is needed. I suppose this pr can do the messy hack with a //TODO comment, and then a seperate pr can fix this. |
One option would be replacing the Lazy with a OnceCell and instantiating it manually in |
I implemented the functionality and edited your checklist - last is the instance info page. IMO though the feature/flag shouldn't be enabled in dev mode - some people might accidentally leave it in debug mode permanently when hosting an instance. Anyway about the instance info: That might necessitate a OnceLock bool anyway for the actual CLI flag (so the template code can access it). In which case, we don't need the code I made about choosing it at runtime, we could simply initialize the OnceLock bool first, then lazily initialize the client, unwrapping that bool. Up to you if you want to go with that method, or just leave it as-is and bolt on the boolean. |
This reverts commit b51a7a3.
Tests are broken right now, right? To properly test it in an applied way, #184 should be fixed. |
@@ -44,6 +46,8 @@ pretty_env_logger = "0.5.0" | |||
dotenvy = "0.15.7" | |||
rss = "2.0.7" | |||
arc-swap = "1.7.1" | |||
rustls = { version = "0.21.12", features = ["dangerous_configuration"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this should ideally be gated under the no-https-verification
feature so that it isn't even enabled unless the no-https-verification
one is.
Rationale: disabling https verification allows debugging the https connection by proxying Redlib through an HTTPS sniffer. This has been discussed in #249.
Closes #249