MCPcopy Create free account
hub / github.com/MengMengCode/GetRealityDomain / ValidateRealityTarget

Function ValidateRealityTarget

scanner.go:221–253  ·  view source on GitHub ↗

ValidateRealityTarget 验证Reality目标的完整性

(result ScanResult)

Source from the content-addressed store, hash-verified

219
220// ValidateRealityTarget 验证Reality目标的完整性
221func ValidateRealityTarget(result ScanResult) (bool, []string) {
222 var issues []string
223
224 // 检查TLS版本
225 if result.TLSVersion != RequiredTLSVersion {
226 issues = append(issues, fmt.Sprintf("TLS版本不符合要求,需要%s,实际%s", RequiredTLSVersion, result.TLSVersion))
227 }
228
229 // 检查ALPN
230 if result.ALPN != RequiredALPN {
231 issues = append(issues, fmt.Sprintf("ALPN协议不符合要求,需要%s,实际%s", RequiredALPN, result.ALPN))
232 }
233
234 // 检查椭圆曲线
235 if result.Curve != RequiredCurve {
236 issues = append(issues, fmt.Sprintf("椭圆曲线不符合要求,需要%s,实际%s", RequiredCurve, result.Curve))
237 }
238
239 // 检查证书域名
240 if result.CertDomain == "" {
241 issues = append(issues, "证书域名为空")
242 }
243
244 // 检查证书颁发者
245 if result.CertIssuer == "" {
246 issues = append(issues, "证书颁发者为空")
247 }
248
249 // TODO: 添加CDN检测
250 // TODO: 添加中国大陆连通性检测
251
252 return len(issues) == 0, issues
253}
254
255// DetectCloudflareCDN 检测是否使用Cloudflare CDN
256func DetectCloudflareCDN(domain string) bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected