From 2ed0f3e8318df7b78e311933cbec8778ed699e70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastian=20K=C3=B6cher?= <git@kchr.de>
Date: Fri, 10 May 2024 14:05:57 +0200
Subject: [PATCH] rustls: Disable logging (#4426)

Disable logging of rustls to get rid off the following log lines:
```
Sending fatal alert BadCertificate
```

Upstream also removed them: https://github.com/rustls/rustls/pull/1278


Closes: https://github.com/paritytech/polkadot-sdk/issues/3252
---
 prdoc/pr_4426.prdoc                         | 15 +++++++++++++++
 substrate/client/tracing/src/logging/mod.rs |  4 ++++
 2 files changed, 19 insertions(+)
 create mode 100644 prdoc/pr_4426.prdoc

diff --git a/prdoc/pr_4426.prdoc b/prdoc/pr_4426.prdoc
new file mode 100644
index 00000000000..5beccbd2a57
--- /dev/null
+++ b/prdoc/pr_4426.prdoc
@@ -0,0 +1,15 @@
+title: "Remove warning about `BadCertificate`"
+
+doc:
+  - audience: Node Operator
+    description: |
+      The node was printing the following warning from time to time:
+      ```
+      Sending fatal alert BadCertificate
+      ```
+
+      This is not an user error and thus, the warning will now not be printed
+      anymore.
+
+crates:
+  - name: sc-cli
diff --git a/substrate/client/tracing/src/logging/mod.rs b/substrate/client/tracing/src/logging/mod.rs
index 8b2ad9b598b..46fd4efb339 100644
--- a/substrate/client/tracing/src/logging/mod.rs
+++ b/substrate/client/tracing/src/logging/mod.rs
@@ -141,6 +141,10 @@ where
 		.add_directive(
 			parse_default_directive("libp2p_mdns::behaviour::iface=off")
 				.expect("provided directive is valid"),
+		)
+		.add_directive(
+			parse_default_directive("rustls::common_state=off")
+				.expect("provided directive is valid"),
 		);
 
 	if let Ok(lvl) = std::env::var("RUST_LOG") {
-- 
GitLab