Skip to content

Commit

Permalink
Fix missing default shadowtls version
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Mar 11, 2023
1 parent 3688f2e commit a88820a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inbound/shadowtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions outbound/shadowtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a88820a

Please sign in to comment.