fix: Upgrade to http2 if the server reports that it supports it (#1166)
The test is disabled as the test server does not support TLS currently but otherwise I'd expect it to pass (tested in another project).
This commit is contained in:
committed by
GitHub
parent
ad21b62fd2
commit
2940740493
@@ -370,17 +370,21 @@ impl Connector {
|
||||
let mut http = hyper_rustls::HttpsConnector::from((http, tls.clone()));
|
||||
let io = http.call(dst).await?;
|
||||
|
||||
if let hyper_rustls::MaybeHttpsStream::Https(stream) = &io {
|
||||
if let hyper_rustls::MaybeHttpsStream::Https(stream) = io {
|
||||
if !self.nodelay {
|
||||
let (io, _) = stream.get_ref();
|
||||
io.set_nodelay(false)?;
|
||||
}
|
||||
Ok(Conn {
|
||||
inner: self.verbose.wrap(RustlsTlsConn { inner: stream }),
|
||||
is_proxy,
|
||||
})
|
||||
} else {
|
||||
Ok(Conn {
|
||||
inner: self.verbose.wrap(io),
|
||||
is_proxy,
|
||||
})
|
||||
}
|
||||
|
||||
Ok(Conn {
|
||||
inner: self.verbose.wrap(io),
|
||||
is_proxy,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user