reqable-app icon indicating copy to clipboard operation
reqable-app copied to clipboard

[bug] 同一个域名的HTTPS请求,有时候会成功请求,有时候会提示握手失败

Open hhs66317 opened this issue 1 month ago • 2 comments

相同环境下,以HTTPS访问指定域名时,有时候一切正常,有时候显示黄色,提示握手失败

我开启调试后,对两次访问的日志进行了导出,脱敏后的数据如下

正常

11-12 13:38:38.2640 [I][Netbare]: [16891] TCP proxy session created!
11-12 13:38:38.2640 [I][Netbare]: [16891] TCP proxy session started!
11-12 13:38:38.2641 [V][Netbare]: [16891] Proxy mirror: a.b.cc:443 => 172.17.224.253:443
11-12 13:38:38.2642 [V][Netbare]: [16891] Using https proxy protocol.
11-12 13:38:38.2643 [V][Netbare]: [16891] [TCP] Connecting to 172.17.224.253:443
11-12 13:38:38.2693 [V][Netbare]: [16891] [TCP] Connected 172.17.224.253:443
11-12 13:38:38.2779 [V][Netbare]: [16891] [SSL] Resolving client hello...
11-12 13:38:38.2779 [V][Netbare]: [16891] [SSL] Alpn offering: http/1.1
11-12 13:38:38.2779 [V][Netbare]: [16891] [SSL] Client Hello SNI: a.b.cc
11-12 13:38:38.2779 [V][Netbare]: [16891] [SSL] Using SNI: a.b.cc
11-12 13:38:38.2780 [V][Netbare]: [16891] [SSL] Handshaking with server...
11-12 13:38:38.2862 [V][Netbare]: [16891] [SSL] Handshake with server finished (TLSv1.3)!
11-12 13:38:38.2863 [V][Netbare]: [16891] [SSL] No alpn selected, use http/1.1 instead
11-12 13:38:38.2863 [V][Netbare]: [16891] [SSL] Generating MITM certificate.
11-12 13:38:38.2863 [V][Netbare]: [16891] [SSL] Handshaking with client...
11-12 13:38:38.2947 [V][Netbare]: [16891] [SSL] Handshake with client finished (TLSv1.3)!
11-12 13:38:38.2951 [V][Netbare]: [16891] [SSL] Detecting application layer protocol...
11-12 13:38:38.2970 [I][Netbare]: [16891] [SSL] HTTP protocol detected!
11-12 13:38:38.2970 [I][Netbare]: [16891] [SSL] Start HTTP1 session #1

异常

11-12 13:24:19.7351 [I][Netbare]: [16747] TCP proxy session created!
11-12 13:24:19.7352 [I][Netbare]: [16747] TCP proxy session started!
11-12 13:24:19.7371 [V][Netbare]: [16747] Proxy mirror: a.b.cc:443 => 172.17.224.253:443
11-12 13:24:19.7371 [V][Netbare]: [16747] Using https proxy protocol.
11-12 13:24:19.7373 [V][Netbare]: [16747] [TCP] Connecting to 172.17.224.253:443
11-12 13:24:19.7428 [V][Netbare]: [16747] [TCP] Connected 172.17.224.253:443
11-12 13:24:19.8355 [V][Netbare]: [16747] [SSL] Resolving client hello...
11-12 13:24:19.8355 [V][Netbare]: [16747] [SSL] Client Hello SNI: a.b.cc
11-12 13:24:19.8355 [V][Netbare]: [16747] [SSL] Using SNI: a.b.cc
11-12 13:24:19.8355 [V][Netbare]: [16747] [SSL] Handshaking with server...
11-12 13:24:20.1522 [E][Netbare]: [16747] [SSL] Failed to handshake with server: asio.ssl:336151598
11-12 13:24:20.1547 [E][Netbare]: [16747] "SSL handshake with server": tlsv1 alert protocol version (SSL routines, ssl3_read_bytes)
11-12 13:24:20.1547 [I][Netbare]: [16747] TCP proxy session closed!

Information windows Unknown Windows 10 Enterprise LTSC 2024 10.0 (Build 26100) 3.0.22(175) x86_64

hhs66317 avatar Nov 12 '25 06:11 hhs66317

@hhs66317 Emmm,这个很难判断是哪里的问题。

MegatronKing avatar Nov 12 '25 12:11 MegatronKing

@hhs66317 Emmm,这个很难判断是哪里的问题。

简单的情况,我自己也判断了。。

这个完全是同一台电脑,环境完全无变化,发起请求的程序也是同一个,唯一的变化就是时间,前后差了十几分钟

这个问题不是偶发一次失败,而是经常会遇到这种情况,为了提供详细日志,我打开调试后,很快就遇到了这两种情况

因为报错信息中,提到用了 tlsv1 ,我还以为是服务器提供的协议太低,我用 curl 也试着请求了下,看协议版本并没有问题

调试列表我经常可以看到各种原有的黄色提示,大多数是HTTPS请求,方法显示CONNECT,错误原有就多了

如果调试日志还看不出问题,可以考虑对于出错的情况,增加更多的调试日志

hhs66317 avatar Nov 13 '25 02:11 hhs66317