Skip to content

Commit 2bc76bd

Browse files
committed
tcp: tls: reduce level of message if no SNI is found
This is similar to what we do in the HTTP parser, if no hostname is there we can't do much but it's not really an error. This was suggested in #6. Signed-off-by: Antoine Tenart <[email protected]>
1 parent aa6110b commit 2bc76bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tcp/tls.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
};
77

88
use anyhow::{bail, Result};
9-
use log::debug;
9+
use log::{debug, info};
1010

1111
use crate::{
1212
config::{self, Config},
@@ -41,7 +41,8 @@ pub(crate) async fn handle_stream(config: Arc<Config>, stream: TcpStream) -> Res
4141
// None was present, which is valid. But we can't do anything with that message.
4242
None => {
4343
tls::alert(rb.get_mut(), tls::AlertDescription::UnrecognizedName)?;
44-
bail!("No SNI hostname in message");
44+
info!("No SNI hostname in message");
45+
return Ok(());
4546
}
4647
};
4748
debug!("Found SNI {hostname} in TLS handshake");

0 commit comments

Comments
 (0)