diff --git a/common/tls/utls_client.go b/common/tls/utls_client.go index c00918fe81..e57f7dc0eb 100644 --- a/common/tls/utls_client.go +++ b/common/tls/utls_client.go @@ -205,7 +205,14 @@ func NewUTLSClient(ctx context.Context, serverAddress string, options option.Out if err != nil { return nil, err } - return &UTLSClientConfig{config: &tlsConfig, paddingSize: options.PaddingSize, id: id}, nil + if options.PaddingSize{ + padding_size, err := option.ParseIntRange(options.PaddingSize) + if err != nil { + return nil, E.Cause(err, "invalid Padding Size supplied") + } + return &UTLSClientConfig{config: &tlsConfig, paddingSize: padding_size, id: id}, nil + } + return &UTLSClientConfig{config: &tlsConfig, id: id}, nil } var ( diff --git a/option/tls.go b/option/tls.go index aac24b4309..4f6bb2dc7d 100644 --- a/option/tls.go +++ b/option/tls.go @@ -23,7 +23,7 @@ type OutboundTLSOptions struct { MixedCaseSNI bool `json:"mixedcase_sni,omitempty"` ServerName string `json:"server_name,omitempty"` Insecure bool `json:"insecure,omitempty"` - PaddingSize [2]int `json:"padding_size,omitempty"` + PaddingSize string `json:"padding_size,omitempty"` ALPN Listable[string] `json:"alpn,omitempty"` MinVersion string `json:"min_version,omitempty"` MaxVersion string `json:"max_version,omitempty"`