@@ -257,7 +257,7 @@ impl<LA, TA> ShadowTlsServer<LA, TA> {
257
257
let mut handshake_stream = TcpStream :: connect ( addr) . await ?;
258
258
mod_tcp_conn ( & mut handshake_stream, true , self . nodelay ) ;
259
259
tracing:: debug!( "handshake server connected: {addr}" ) ;
260
-
260
+ tracing :: trace! ( "ClientHello frame {first_client_frame:?}" ) ;
261
261
let ( res, _) = handshake_stream. write_all ( first_client_frame) . await ;
262
262
res?;
263
263
if !client_hello_pass {
@@ -281,7 +281,7 @@ impl<LA, TA> ShadowTlsServer<LA, TA> {
281
281
return Ok ( ( ) ) ;
282
282
}
283
283
} ;
284
- tracing:: debug!( "ServerRandom extracted: {server_random:?}" ) ;
284
+ tracing:: debug!( "Client authenticated. ServerRandom extracted: {server_random:?}" ) ;
285
285
286
286
if !support_tls13 ( & first_server_frame) {
287
287
tracing:: error!( "TLS 1.3 is not supported, will copy bidirectional" ) ;
@@ -780,21 +780,13 @@ async fn copy_by_frame_until_hmac_matches(
780
780
let mut g_buffer = Vec :: new ( ) ;
781
781
782
782
loop {
783
- tracing:: debug!( "copy_by_frame_until_hmac_matches getting frame" ) ;
784
783
let buffer = read_exact_frame_into ( & mut read, g_buffer) . await ?;
785
- tracing:: debug!( "copy_by_frame_until_hmac_matches get a frame: {buffer:?}" , ) ;
786
784
if buffer. len ( ) > 9 && buffer[ 0 ] == APPLICATION_DATA {
787
785
// check hmac
788
786
let mut tmp_hmac = hmac. to_owned ( ) ;
789
787
tmp_hmac. update ( & buffer[ TLS_HMAC_HEADER_SIZE ..] ) ;
790
788
let h = tmp_hmac. finalize ( ) ;
791
789
792
- tracing:: debug!(
793
- "tmp hmac({:?}) = {h:?}, raw = {:?}" ,
794
- & buffer[ TLS_HMAC_HEADER_SIZE ..] ,
795
- & buffer[ TLS_HEADER_SIZE ..TLS_HMAC_HEADER_SIZE ]
796
- ) ;
797
-
798
790
if buffer[ TLS_HEADER_SIZE ..TLS_HMAC_HEADER_SIZE ] == h {
799
791
hmac. update ( & buffer[ TLS_HMAC_HEADER_SIZE ..] ) ;
800
792
hmac. update ( & buffer[ TLS_HEADER_SIZE ..TLS_HMAC_HEADER_SIZE ] ) ;
@@ -829,7 +821,6 @@ async fn copy_by_frame_with_modification(
829
821
monoio:: select! {
830
822
// this function can be stopped by a channel when reading.
831
823
_ = & mut stop => {
832
- tracing:: debug!( "copy_by_frame_with_modification recv stop" ) ;
833
824
return Ok ( ( ) ) ;
834
825
} ,
835
826
buffer_res = read_exact_frame_into( & mut read, g_buffer) => {
@@ -893,10 +884,11 @@ fn support_tls13(frame: &[u8]) -> bool {
893
884
read_ok ! ( cursor. skip_by_u16( ) ) ;
894
885
continue ;
895
886
}
896
- tracing:: debug!( "found supported_versions extension" ) ;
897
887
let ext_len = read_ok ! ( cursor. read_u16:: <BigEndian >( ) ) ;
898
888
let ext_val = read_ok ! ( cursor. read_u16:: <BigEndian >( ) ) ;
899
- return ext_len == 2 && ext_val == TLS_13 ;
889
+ let use_tls13 = ext_len == 2 && ext_val == TLS_13 ;
890
+ tracing:: debug!( "found supported_versions extension, tls1.3: {use_tls13}" ) ;
891
+ return use_tls13;
900
892
}
901
893
false
902
894
}
0 commit comments