mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
feat: 支持国密 TLS 网站扫描
- 添加 tjfoc/gmsm 依赖,提供 gmtls 国密 TLS 支持 - 新增国密 HTTP 客户端 ClientGM/ClientNoRedirectGM - DetectHTTPScheme 增加国密 TLS 回退检测,返回 https-gm 协议标识 - webtitle 插件识别并路由到国密客户端 - DoRequest 标准 TLS 失败时自动回退国密客户端
This commit is contained in:
@@ -446,6 +446,19 @@ func DoRequest(req *http.Request, redirect bool) (*Response, error) {
|
||||
oResp, err = ClientNoRedirect.Do(req)
|
||||
}
|
||||
|
||||
// 标准TLS连接失败时,尝试国密TLS客户端
|
||||
if err != nil && req.URL.Scheme == "https" {
|
||||
if redirect {
|
||||
if oResp2, err2 := ClientGM.Do(req); err2 == nil {
|
||||
oResp, err = oResp2, nil
|
||||
}
|
||||
} else {
|
||||
if oResp2, err2 := ClientNoRedirectGM.Do(req); err2 == nil {
|
||||
oResp, err = oResp2, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
// HTTP请求失败,计为TCP失败
|
||||
common.GetGlobalState().IncrementTCPFailedPacketCount()
|
||||
|
||||
Reference in New Issue
Block a user