fix(sora): 默认开启 TLS 指纹并支持显式关闭

This commit is contained in:
yangjianbo
2026-02-19 08:30:54 +08:00
parent be09188bda
commit 0832dfb32e
2 changed files with 6 additions and 3 deletions

View File

@@ -781,9 +781,9 @@ func parseSoraRemainingSummary(body []byte) string {
func (s *AccountTestService) shouldEnableSoraTLSFingerprint() bool { func (s *AccountTestService) shouldEnableSoraTLSFingerprint() bool {
if s == nil || s.cfg == nil { if s == nil || s.cfg == nil {
return false return true
} }
return s.cfg.Gateway.TLSFingerprint.Enabled && !s.cfg.Sora.Client.DisableTLSFingerprint return !s.cfg.Sora.Client.DisableTLSFingerprint
} }
func isCloudflareChallengeResponse(statusCode int, body []byte) bool { func isCloudflareChallengeResponse(statusCode int, body []byte) bool {

View File

@@ -1101,7 +1101,10 @@ func shouldAttemptSoraTokenRecover(statusCode int, rawURL string) bool {
} }
func (c *SoraDirectClient) doHTTP(req *http.Request, proxyURL string, account *Account) (*http.Response, error) { func (c *SoraDirectClient) doHTTP(req *http.Request, proxyURL string, account *Account) (*http.Response, error) {
enableTLS := c != nil && c.cfg != nil && c.cfg.Gateway.TLSFingerprint.Enabled && !c.cfg.Sora.Client.DisableTLSFingerprint enableTLS := true
if c != nil && c.cfg != nil && c.cfg.Sora.Client.DisableTLSFingerprint {
enableTLS = false
}
if c.httpUpstream != nil { if c.httpUpstream != nil {
accountID := int64(0) accountID := int64(0)
accountConcurrency := 0 accountConcurrency := 0