fix: anytls listener config parsing

This commit is contained in:
wwqgtxx committed 2026-07-14 12:31:41 +08:00
1 parent 94409eb659
commit ba5c45b735
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -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必须不为空
+2 -2
View File
@@ -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"`
+2 -2
View File
@@ -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"`