Skip to content

Commit 050bc65

Browse files
committed
improved sqlpage.fetch logging
1 parent 515931e commit 050bc65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/webserver/database/sqlpage_functions/functions.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,13 @@ fn make_http_client(config: &crate::app_config::AppConfig) -> anyhow::Result<awc
194194
let connector = if config.system_root_ca_certificates {
195195
let roots = NATIVE_CERTS
196196
.get_or_init(|| {
197+
log::debug!("Loading native certificates because system_root_ca_certificates is enabled");
197198
let certs = rustls_native_certs::load_native_certs()
198199
.with_context(|| "Initial native certificates load failed")?;
200+
log::info!("Loaded {} native certificates", certs.len());
199201
let mut roots = rustls::RootCertStore::empty();
200202
for cert in certs {
203+
log::trace!("Adding native certificate to root store: {cert:?}");
201204
roots.add(cert.clone()).with_context(|| {
202205
format!("Unable to add certificate to root store: {cert:?}")
203206
})?;
@@ -213,12 +216,14 @@ fn make_http_client(config: &crate::app_config::AppConfig) -> anyhow::Result<awc
213216

214217
awc::Connector::new().rustls_0_22(std::sync::Arc::new(tls_conf))
215218
} else {
219+
log::debug!("Using the default tls connector with builtin certs because system_root_ca_certificates is disabled");
216220
awc::Connector::new()
217221
};
218222
let client = awc::Client::builder()
219223
.connector(connector)
220224
.add_default_header((awc::http::header::USER_AGENT, env!("CARGO_PKG_NAME")))
221225
.finish();
226+
log::debug!("Created HTTP client");
222227
Ok(client)
223228
}
224229

0 commit comments

Comments
 (0)