Skip to content

Commit 52ad793

Browse files
committed
fix: shadowtls v1 not work
1 parent 2fb9331 commit 52ad793

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

adapter/outbound/shadowsocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type gostObfsOption struct {
8484
}
8585

8686
type shadowTLSOption struct {
87-
Password string `obfs:"password"`
87+
Password string `obfs:"password,omitempty"`
8888
Host string `obfs:"host"`
8989
Fingerprint string `obfs:"fingerprint,omitempty"`
9090
SkipCertVerify bool `obfs:"skip-cert-verify,omitempty"`

transport/sing-shadowtls/shadowtls.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func NewShadowTLS(ctx context.Context, conn net.Conn, option *ShadowTLSOption) (
3737
InsecureSkipVerify: option.SkipCertVerify,
3838
ServerName: option.Host,
3939
}
40+
if option.Version == 1 {
41+
tlsConfig.MaxVersion = tls.VersionTLS12 // ShadowTLS v1 only support TLS 1.2
42+
}
4043

4144
var err error
4245
tlsConfig, err = ca.GetSpecifiedFingerprintTLSConfig(tlsConfig, option.Fingerprint)

0 commit comments

Comments
 (0)