Skip to content

Commit

Permalink
tcp: tls: reduce level of message if no SNI is found
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
atenart committed Dec 12, 2024
1 parent aa6110b commit 2bc76bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tcp/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};

use anyhow::{bail, Result};
use log::debug;
use log::{debug, info};

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

0 comments on commit 2bc76bd

Please sign in to comment.