mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
Update default_port and sni logic to improve reverse proxy reachability (#947)
This commit is contained in:
@@ -202,8 +202,11 @@ impl WSTunnelConnector {
|
||||
init_crypto_provider();
|
||||
let tls_conn =
|
||||
tokio_rustls::TlsConnector::from(Arc::new(get_insecure_tls_client_config()));
|
||||
// Modify SNI logic: always use "localhost" as SNI to avoid IP blocking.
|
||||
let sni = "localhost";
|
||||
// Modify SNI logic: use "localhost" as SNI for url without domain to avoid IP blocking.
|
||||
let sni = match addr.domain() {
|
||||
None => "localhost".to_string(),
|
||||
Some(domain) => domain.to_string(),
|
||||
};
|
||||
let server_name = rustls::pki_types::ServerName::try_from(sni)
|
||||
.map_err(|_| TunnelError::InvalidProtocol("Invalid SNI".to_string()))?;
|
||||
let stream = tls_conn.connect(server_name, stream).await?;
|
||||
|
||||
Reference in New Issue
Block a user