Skip to content

Commit

Permalink
Remove brackets from sni str to prevent endpoint.connect from getting…
Browse files Browse the repository at this point in the history
… wrong server_name when client uses ipv6 address (#55)
  • Loading branch information
yhtq authored Jul 28, 2024
1 parent 9fc7b45 commit 205f0bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ pub async fn run(options: Opt) -> Result<(), Box<dyn Error>> {
let remote = sock_list[0];
let sni = url.host_str().unwrap_or("THIS_HOSTNAME_SHOULD_NOT_BE_USED");

// Remove brackets from IPv6 address
let sni = sni.trim_start_matches('[').trim_end_matches(']');

info!("[client] Connecting to: {} <- {}", remote, sni);

let endpoint = make_client_endpoint(match options.bind_addr {
Expand Down

0 comments on commit 205f0bc

Please sign in to comment.