소스 검색

Fix missing default shadowtls version

世界 2 년 전
부모
커밋
a88820af31
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      inbound/shadowtls.go
  2. 5 0
      outbound/shadowtls.go

+ 4 - 0
inbound/shadowtls.go

@@ -32,6 +32,10 @@ func NewShadowTLS(ctx context.Context, router adapter.Router, logger log.Context
 		},
 	}
 
+	if options.Version == 0 {
+		options.Version = 1
+	}
+
 	var handshakeForServerName map[string]shadowtls.HandshakeConfig
 	if options.Version > 1 {
 		handshakeForServerName = make(map[string]shadowtls.HandshakeConfig)

+ 5 - 0
outbound/shadowtls.go

@@ -37,6 +37,11 @@ func NewShadowTLS(ctx context.Context, router adapter.Router, logger log.Context
 	if options.TLS == nil || !options.TLS.Enabled {
 		return nil, C.ErrTLSRequired
 	}
+
+	if options.Version == 0 {
+		options.Version = 1
+	}
+
 	if options.Version == 1 {
 		options.TLS.MinVersion = "1.2"
 		options.TLS.MaxVersion = "1.2"