diff --git a/docs/config.yaml b/docs/config.yaml index 1e18890e7..93fe261b4 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -2310,7 +2310,7 @@ listeners: users: username1: password1 username2: password2 - # "certificate" and "private-key" are required + # 未启用 "jls-config" 且 "allow-insecure" 不为 true 时,必须填写 "certificate" 和 "private-key";启用 JLS 时不要填写 certificate: ./server.crt # 证书 PEM 格式,或者 证书的路径 private-key: ./server.key # 下面两项为mTLS配置项,如果client-auth-type设置为 "verify-if-given" 或 "require-and-verify" 则client-auth-cert必须不为空 diff --git a/listener/config/anytls.go b/listener/config/anytls.go index 0606c5012..e9f52c152 100644 --- a/listener/config/anytls.go +++ b/listener/config/anytls.go @@ -8,8 +8,8 @@ type AnyTLSServer struct { Enable bool `yaml:"enable" json:"enable"` Listen string `yaml:"listen" json:"listen"` Users map[string]string `yaml:"users" json:"users,omitempty"` - Certificate string `yaml:"certificate" json:"certificate"` - PrivateKey string `yaml:"private-key" json:"private-key"` + Certificate string `yaml:"certificate,omitempty" json:"certificate,omitempty"` + PrivateKey string `yaml:"private-key,omitempty" json:"private-key,omitempty"` ClientAuthType string `yaml:"client-auth-type" json:"client-auth-type,omitempty"` ClientAuthCert string `yaml:"client-auth-cert" json:"client-auth-cert,omitempty"` EchKey string `yaml:"ech-key" json:"ech-key,omitempty"` diff --git a/listener/inbound/anytls.go b/listener/inbound/anytls.go index 422d47211..e8a8fe9d9 100644 --- a/listener/inbound/anytls.go +++ b/listener/inbound/anytls.go @@ -12,8 +12,8 @@ import ( type AnyTLSOption struct { BaseOption Users map[string]string `inbound:"users,omitempty"` - Certificate string `inbound:"certificate"` - PrivateKey string `inbound:"private-key"` + Certificate string `inbound:"certificate,omitempty"` + PrivateKey string `inbound:"private-key,omitempty"` ClientAuthType string `inbound:"client-auth-type,omitempty"` ClientAuthCert string `inbound:"client-auth-cert,omitempty"` EchKey string `inbound:"ech-key,omitempty"`