summaryrefslogtreecommitdiff
path: root/ext/websocket
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-07-02 01:09:47 +0100
committerGitHub <noreply@github.com>2024-07-02 02:09:47 +0200
commit8db420d552bc1d480a21748d73b566b623a266c1 (patch)
tree4634447ec235f3d4f743a233c500425409236097 /ext/websocket
parent9c1f741112f87ba97125e19efb3abf918205ad23 (diff)
chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)
Reland of https://github.com/denoland/deno/pull/24056 that doesn't suffer from the problem that was discovered in https://github.com/denoland/deno/pull/24261. It uses upgraded `hyper` and `hyper-util` that fixed the previous problem in https://github.com/hyperium/hyper/pull/3691.
Diffstat (limited to 'ext/websocket')
-rw-r--r--ext/websocket/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs
index 5c3e8d7b1..9e320040b 100644
--- a/ext/websocket/lib.rs
+++ b/ext/websocket/lib.rs
@@ -36,14 +36,13 @@ use http::Request;
use http::StatusCode;
use http::Uri;
use once_cell::sync::Lazy;
+use rustls_tokio_stream::rustls::pki_types::ServerName;
use rustls_tokio_stream::rustls::RootCertStore;
-use rustls_tokio_stream::rustls::ServerName;
use rustls_tokio_stream::TlsStream;
use serde::Serialize;
use std::borrow::Cow;
use std::cell::Cell;
use std::cell::RefCell;
-use std::convert::TryFrom;
use std::fmt;
use std::future::Future;
use std::num::NonZeroUsize;
@@ -245,8 +244,8 @@ async fn handshake_http1_wss(
) -> Result<(WebSocket<WebSocketStream>, http::HeaderMap), AnyError> {
let tcp_socket = TcpStream::connect(addr).await?;
let tls_config = create_ws_client_config(state, SocketUse::Http1Only)?;
- let dnsname =
- ServerName::try_from(domain).map_err(|_| invalid_hostname(domain))?;
+ let dnsname = ServerName::try_from(domain.to_string())
+ .map_err(|_| invalid_hostname(domain))?;
let mut tls_connector = TlsStream::new_client_side(
tcp_socket,
ClientConnection::new(tls_config.into(), dnsname)?,
@@ -270,8 +269,8 @@ async fn handshake_http2_wss(
) -> Result<(WebSocket<WebSocketStream>, http::HeaderMap), AnyError> {
let tcp_socket = TcpStream::connect(addr).await?;
let tls_config = create_ws_client_config(state, SocketUse::Http2Only)?;
- let dnsname =
- ServerName::try_from(domain).map_err(|_| invalid_hostname(domain))?;
+ let dnsname = ServerName::try_from(domain.to_string())
+ .map_err(|_| invalid_hostname(domain))?;
// We need to better expose the underlying errors here
let mut tls_connector = TlsStream::new_client_side(
tcp_socket,