From 18e81fbaf80e501d19ebc8e4a4450f7005156cab Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 3 Feb 2024 16:28:52 +0900 Subject: [PATCH] feat(tls): Implement AsMut for Certificate --- tonic/src/transport/tls.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tonic/src/transport/tls.rs b/tonic/src/transport/tls.rs index 1dd4c06a4..c2b7ef23f 100644 --- a/tonic/src/transport/tls.rs +++ b/tonic/src/transport/tls.rs @@ -42,6 +42,12 @@ impl AsRef<[u8]> for Certificate { } } +impl AsMut<[u8]> for Certificate { + fn as_mut(&mut self) -> &mut [u8] { + self.pem.as_mut() + } +} + impl Identity { /// Parse a PEM encoded certificate and private key. ///