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

✨ Config option to use operating system certificates alongside rustls certificates #620

Open
wants to merge 3 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
pub proxy: Option<Proxy>,
/// It stores the number of https connections to keep in the pool.
pub number_of_https_connections: u8,
/// It stores the operating system's TLS certificates for https requests.
pub operating_system_tls_certificates: bool,
}

impl Config {
Expand Down Expand Up @@ -131,7 +133,7 @@
})
});

Ok(Config {

Check failure on line 136 in src/config/parser.rs

View workflow job for this annotation

GitHub Actions / Rust project

missing field `operating_system_tls_certificates` in initializer of `config::parser::Config`
port: globals.get::<_, u16>("port")?,
binding_ip: globals.get::<_, String>("binding_ip")?,
style: Style::new(
Expand Down
2 changes: 2 additions & 0 deletions src/results/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub async fn aggregate(
.tcp_keepalive(Duration::from_secs(config.tcp_connection_keep_alive as u64))
.pool_max_idle_per_host(config.number_of_https_connections as usize)
.connect_timeout(Duration::from_secs(config.request_timeout as u64)) // Add timeout to request to avoid DDOSing the server
.use_rustls_tls()
.tls_built_in_root_certs(config.operating_system_tls_certificates)
.https_only(true)
.gzip(true)
.brotli(true)
Expand Down
2 changes: 2 additions & 0 deletions websurfx/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ rate_limiter = {
-- Set whether the server will use an adaptive/dynamic HTTPS window size, see https://httpwg.org/specs/rfc9113.html#fc-principles
https_adaptive_window_size = false

operating_system_tls_certificates = true -- Set whether the server will use operating system's tls certificates alongside rustls certificates while fetching search results from the upstream engines.

number_of_https_connections = 10 -- the number of https connections that should be available in the connection pool.
-- Set keep-alive timer in seconds; keeps clients connected to the HTTP server, different from the connection to upstream search engines
client_connection_keep_alive = 120
Expand Down
Loading