Remove brackets from IPv6 literals before passing to TLS connector (#115)
This commit is contained in:
@@ -316,7 +316,7 @@ pub(crate) fn connect_https(unit: &Unit) -> Result<Stream, Error> {
|
|||||||
let sock = connect_host(unit, hostname, port)?;
|
let sock = connect_host(unit, hostname, port)?;
|
||||||
|
|
||||||
let tls_connector = TlsConnector::new().map_err(|e| Error::TlsError(e))?;
|
let tls_connector = TlsConnector::new().map_err(|e| Error::TlsError(e))?;
|
||||||
let stream = tls_connector.connect(hostname, sock).map_err(|e| match e {
|
let stream = tls_connector.connect(&hostname.trim_matches(|c| c == '[' || c == ']'), sock).map_err(|e| match e {
|
||||||
HandshakeError::Failure(err) => Error::TlsError(err),
|
HandshakeError::Failure(err) => Error::TlsError(err),
|
||||||
_ => Error::BadStatusRead,
|
_ => Error::BadStatusRead,
|
||||||
})?;
|
})?;
|
||||||
|
|||||||
Reference in New Issue
Block a user