Skip to content

Commit 3572209

Browse files
ari-ahmRPRX
andauthored
REALITY client: Clearer log when receiving real certificate (#5427)
Co-authored-by: RPRX <[email protected]>
1 parent dd757ca commit 3572209

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

transport/internet/reality/reality.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,14 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
180180
fmt.Printf("REALITY localAddr: %v\tuConn.Verified: %v\n", localAddr, uConn.Verified)
181181
}
182182
if !uConn.Verified {
183+
errors.LogError(ctx, "REALITY: received real certificate (potential MITM or redirection)")
183184
go func() {
184185
client := &http.Client{
185186
Transport: &http2.Transport{
186187
DialTLSContext: func(ctx context.Context, network, addr string, cfg *gotls.Config) (net.Conn, error) {
187-
fmt.Printf("REALITY localAddr: %v\tDialTLSContext\n", localAddr)
188+
if config.Show {
189+
fmt.Printf("REALITY localAddr: %v\tDialTLSContext\n", localAddr)
190+
}
188191
return uConn, nil
189192
},
190193
},

0 commit comments

Comments
 (0)