Skip to content

Commit

Permalink
don't verify at all (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug authored Dec 27, 2023
1 parent bac57d3 commit f76ef2e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions clash_lib/src/common/tls.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use once_cell::sync::Lazy;
use rustls::{
client::{ServerCertVerified, ServerCertVerifier, WebPkiVerifier},
OwnedTrustAnchor, RootCertStore,
client::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier, WebPkiVerifier},
DigitallySignedStruct, OwnedTrustAnchor, RootCertStore,
};
use tracing::warn;

Expand Down Expand Up @@ -38,6 +38,24 @@ impl ServerCertVerifier for DummyTlsVerifier {
) -> Result<ServerCertVerified, rustls::Error> {
Ok(ServerCertVerified::assertion())
}

fn verify_tls12_signature(
&self,
_message: &[u8],
_cert: &Certificate,
_dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, rustls::Error> {
Ok(HandshakeSignatureValid::assertion())
}

fn verify_tls13_signature(
&self,
_message: &[u8],
_cert: &Certificate,
_dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, rustls::Error> {
Ok(HandshakeSignatureValid::assertion())
}
}

pub struct NoHostnameTlsVerifier;
Expand Down

0 comments on commit f76ef2e

Please sign in to comment.