Skip to content

Commit 8cc640b

Browse files
committed
fix: don't check certs
1 parent 6b33900 commit 8cc640b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/elastic_push.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fn elastic_client(config: &ElasticConfig) -> Result<Elasticsearch, Box<dyn Error
1111
let credentials = config.credentials()?;
1212
let transport = elasticsearch::http::transport::TransportBuilder::new(conn_pool)
1313
.auth(credentials)
14+
.cert_validation(elasticsearch::cert::CertificateValidation::None)
1415
.build()?;
1516
Ok(Elasticsearch::new(transport))
1617
}
@@ -19,7 +20,7 @@ fn elastic_client(config: &ElasticConfig) -> Result<Elasticsearch, Box<dyn Error
1920
fn json_from_logrecord(record: &LogRecord) -> Result<serde_json::Value, serde_json::Error> {
2021
// Currently a naive implementation but could be:
2122
// serde_json::json!({"field_a": record.a, "field_b": record.b, etc...})
22-
serde_json::to_value(record)
23+
dbg!(serde_json::to_value(record))
2324
}
2425

2526
fn make_json_body(
@@ -57,9 +58,10 @@ pub async fn consumer_loop(rx: &mut mpsc::UnboundedReceiver<LogRecord>, config:
5758
.send()
5859
.await;
5960
println!(
60-
"sent {} logs to elastic, response OK: {:?}",
61+
"sent {} logs to elastic, response OK: {:?} \n {:?}",
6162
open,
62-
response.is_ok()
63+
response.is_ok(),
64+
response
6365
);
6466
buffer = Vec::with_capacity(config.chunk_size.into());
6567
}

0 commit comments

Comments
 (0)