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

feat: add server config cache #48

Closed
wants to merge 5 commits into from
Closed

Conversation

futurist
Copy link
Contributor

@futurist futurist commented Jul 30, 2024

resolve TODO and improve performance.
NOTICE: this need rust 1.80's LazyLock feature.

Copy link
Owner

@hatoo hatoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I added some review.

src/tls.rs Outdated
use dashmap::{try_result::TryResult, DashMap};
use rustls::ServerConfig;

static SERVER_CONFIG_CACHE: LazyLock<DashMap<String, rustls::ServerConfig>> = LazyLock::new(|| DashMap::new());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caches should be held for each MitmProxy instance to support multiple proxy servers with different root certs.

Currently, it may cache a cert for different root cert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a commit to fix this, please re-check.

@futurist futurist requested a review from hatoo August 28, 2024 13:38
@hatoo
Copy link
Owner

hatoo commented Sep 28, 2024

I'm sorry for not getting back to you sooner.
I've decided to use moka to cache generated certs along with some code changes in #52
I'll merge #52 and close this 🙇

@hatoo hatoo closed this Sep 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants