We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8803232 commit e2e8b94Copy full SHA for e2e8b94
src/lib.rs
@@ -373,6 +373,9 @@ where
373
#[inline]
374
fn domain(request: &tungstenite::handshake::client::Request) -> Result<String, WsError> {
375
match request.uri().host() {
376
+ // rustls expects IPv6 addresses without the surrounding [] brackets
377
+ #[cfg(feature = "__rustls-tls")]
378
+ Some(d) if d.starts_with('[') && d.ends_with(']') => Ok(d[1..d.len() - 1].to_string()),
379
Some(d) => Ok(d.to_string()),
380
None => Err(WsError::Url(tungstenite::error::UrlError::NoHostName)),
381
}
0 commit comments