diff --git a/lib/vector-core/src/tls/incoming.rs b/lib/vector-core/src/tls/incoming.rs index ca1d1f7dbc185..e9947ed53d868 100644 --- a/lib/vector-core/src/tls/incoming.rs +++ b/lib/vector-core/src/tls/incoming.rs @@ -28,14 +28,11 @@ use crate::tcp::{self, TcpKeepaliveConfig}; impl TlsSettings { pub fn acceptor(&self) -> crate::tls::Result { - match self.identity { - None => Err(TlsError::MissingRequiredIdentity), - Some(_) => { - let mut acceptor = SslAcceptor::mozilla_intermediate(SslMethod::tls()) - .context(CreateAcceptorSnafu)?; - self.apply_context_base(&mut acceptor, true)?; - Ok(acceptor.build()) - } + if self.identity.is_none() { Err(TlsError::MissingRequiredIdentity) } else { + let mut acceptor = SslAcceptor::mozilla_intermediate(SslMethod::tls()) + .context(CreateAcceptorSnafu)?; + self.apply_context_base(&mut acceptor, true)?; + Ok(acceptor.build()) } } }