fix: shadowtls v1 not work

This commit is contained in:
wwqgtxx 2025-04-22 20:09:24 +08:00
parent 2fb9331211
commit 52ad793d11
2 changed files with 4 additions and 1 deletions

View File

@ -84,7 +84,7 @@ type gostObfsOption struct {
}
type shadowTLSOption struct {
Password string `obfs:"password"`
Password string `obfs:"password,omitempty"`
Host string `obfs:"host"`
Fingerprint string `obfs:"fingerprint,omitempty"`
SkipCertVerify bool `obfs:"skip-cert-verify,omitempty"`

View File

@ -37,6 +37,9 @@ func NewShadowTLS(ctx context.Context, conn net.Conn, option *ShadowTLSOption) (
InsecureSkipVerify: option.SkipCertVerify,
ServerName: option.Host,
}
if option.Version == 1 {
tlsConfig.MaxVersion = tls.VersionTLS12 // ShadowTLS v1 only support TLS 1.2
}
var err error
tlsConfig, err = ca.GetSpecifiedFingerprintTLSConfig(tlsConfig, option.Fingerprint)