mobile wss use rustls_platform_verifier

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-10-21 20:56:55 +08:00
parent 5ed0afde08
commit bf9a79fda5
5 changed files with 77 additions and 7 deletions

View File

@@ -56,7 +56,6 @@ const MAXIMUM_RESPONSE_HEADERS: usize = 16;
const DEFINE_TIME_OUT: u64 = 600;
pub trait IntoUrl {
// Besides parsing as a valid `Url`, the `Url` must be a valid
// `http::Uri`, in that it makes sense to use in a network request.
fn into_url(self) -> Result<Url, ProxyError>;
@@ -455,8 +454,10 @@ impl Proxy {
Input: AsyncRead + AsyncWrite + Unpin,
T: IntoTargetAddr<'a>,
{
use rustls_platform_verifier::ConfigVerifierExt;
use std::convert::TryFrom;
let verifier = rustls_platform_verifier::tls_config();
let verifier = tokio_rustls::rustls::ClientConfig::with_platform_verifier()
.map_err(|e| ProxyError::IoError(std::io::Error::other(e)))?;
let url_domain = self.intercept.get_domain()?;
let domain = rustls_pki_types::ServerName::try_from(url_domain.as_str())